« first day (2290 days earlier)      last day (2660 days later) » 

5:00 PM
Its so interesting but I think I would need a year of planning
 
To be fair
 
and a personal butler like batman
 
There's a C to JavaScript compiler
 
I think JS was done in an afternoon
 
So technically, you could take any program that compiles to C, and compile it into JS by extension.
There's a great talk about the Life and Death of JavaScript, in which they give a demonstration for that
They run Firefox in Safari
They actually compiled Firefox into JS, and ran it inside a web page
And then they compiled Safari to JS, and ran Firefox in Safari in Chrome :D
 
5:02 PM
yea, i saw that. though.. i think it was chrome.
 
I cant imagine writing a compiler / transpiler in a day...omg
 
@Luggage It doesn't really matter
@Asperger It all depends on what you need from your new source language
 
syntax planning + compiler architecture + optimization + speed etc
 
@MadaraUchiha not actually, it is fiction
 
I can define a language "h" that has only one valid program "h", which compiles to console.log("Hello World!")
And write a compiler for that in 5 minutes
 
5:03 PM
and 4 of those minutes were thinking of a name
 
But yeah, @Asperger I suggest that before you do that, you get acquainted with at least one Lispy language
 
@MadaraUchiha im too scared and Im a noob xD
 
The common theme for Lispy languages is that they have language level abstractions, you write your own language on top of Lisp, which then compiles to Lisp, and solves your problem.
@Asperger Then, why'd you undertake writing a language?
It's not exactly a trivial task.
 
we're always prepared to just try something.
he's only unprepared to make a GOOD language
 
5:06 PM
@MadaraUchiha I actually never planned to, I just find it interesting how things work. 2 hours ago a wrote a small "transpiler" which converts func() { log(1) } to void func { printf("%d", 1); }
and then I started to get interested
 
@Asperger Definitely check out Lisp
There's Clojure for the JVM (if you're already familiar somewhat with Java)
There's Common Lisp which @FlorianMargaine would be delighted to help you with
 
@MadaraUchiha definately will do that. Ya I worked with java before.
 
it's just a trap so FlorianMargaine can get you to go to emacs church.
 
I have a dream, I dream of the day when one could write Lisp without emacs
 
and strap emacs to yourself and run into a crowd.
 
5:09 PM
To be fair Clojure has a pretty good support in IntelliJ with a plugin
 
So a language compiling to another language isnt cheating?
I mean cheating in a sense of: "i dont need to be ashamed of it"
 
it's common..
 
@Asperger There's no such thing as cheating.
 
clojure, typescript, etc.
 
because well real languages compile to object code etc
 
5:11 PM
There's working and not working, and after that, elegant or not elegant.
@Asperger Java compiles to Java Bytecode
 
@MadaraUchiha ya thats true.
 
TypeScript compiles to JavaScript
 
tsc compiles typescript to javascript
 
rm compiles typescript into
 
Things get harder if you want live bebugging support for a language
 
5:13 PM
@Luggage clever
Writing a compiler is a daunting task.
 
like it could work with an incremental compiler
 
At this point you're better off not worrying about tooling.
 
@Asperger TypeScript is a compile only language.
It has no runtime
Therefore, it has no debugging.
 
but the thing you want is a "source map", if you are outputing c
 
You can debug the resulting JavaScript.
 
5:15 PM
if its incremental I could get reports on where the error occurs within the script prior to compilation
 
aka debugging symbols
 
@Asperger JavaScript does that with sourcemaps
Because there could be many stages of compilation or transformation between the source code and the actual result
 
@MadaraUchiha oh, didnt know its done like that
 
For example, you could remove comments, concat all files, minify, obfuscate, etc.
So there's a file that maps character positions in the target file into lines in the source files
It's a clever solution in theory, but it doesn't work very well.
 
If only I had more time, im currently in the second year in a vocational school at zürich. We learn application developer.
@MadaraUchiha being realistic its definately at least a year of work right? How long would you need to create something like typescript?
 
5:19 PM
@Asperger JavaScript was created in 10 days
TypeScript is still in development
(stable, but in development)
To be fair, most languages today are under active development
 
so. some time between 1 week and 1 decade.
 
@MadaraUchiha how can somecreate create js in 10 days? holy carp. He must be really talented.
 
@Asperger Brendan Eich, and yes, very talented.
 
Ok but js didnt have all these features as it does now.
 
@Asperger Yup
 
5:20 PM
true
 
That's true.
 
I assume it was far more simple, no debugging support etc. Version being < ES5
 
There's a great talk buy Guy Steele called "Growing a language"
The main take is that you shouldn't design a language that has everything
 
the one where he defines everything?
 
But instead design a language that's easily extensible by its users
@Luggage Yeah
 
5:21 PM
aye, good talk.
 
@MadaraUchiha which brings us back to "planning"
 
@Asperger Right
 
first is learning. Go make a language. Dont' worry if it'll be the best (it won't)
 
Good planning can take really long. My vocational trainers told me that programming is 80% planning.
 
5:22 PM
@Asperger Most languages today aren't well thought
 
80% screwing up and learning for those mistakes.
 
like php
 
JavaScript wasn't especially well thought
Neither was PHP
 
What about go?
 
But both got accepted because who knows why
 
5:23 PM
right place at the right time
 
^
Most likely
 
Objective C.....
 
because they had no choice
 
Subjective C
 
not sure how good that one was thought out. Only saw the syntax and thought "omg"
 
5:24 PM
@Asperger Rather badly
Why do you think Swift is a thing?
 
@MadaraUchiha because it combines the best from C# and Javascript? Had a small glimpse at the syntax
Its definately well organized
 
To be fair I haven't touched Swift in a long, long time
But when I last tried it wasn't nearly ready for production in my opinion back then
 
@MadaraUchiha is it bad? I just had a small look at it a month ago.
 
@Asperger It was bad a long time ago
That's the same as saying "I have no idea how it is now"
 
Well if the basis sucks then....its the same as building a skyscraper which is partially incomplete in the first level.
the higher you build it the bigger the chances of collapse
It wont happen though if the language is planned well (or at least not as fast)
I might be wrong though. I mean I can just give jquery as an example. The core is kind of rotten and they build on that rotten core.
 
5:31 PM
@Asperger ... Have you read "programming sucks"?
 
@MadaraUchiha nope
 
@MadaraUchiha reading it : ) looks good
@MadaraUchiha great article!
@MadaraUchiha can dom repaints really get my cpu spinning?
I mean in the scenario:
requestAnimationFrame -> animate width
 
user5870134
0
Q: To infinity and beyond in JavaScript

MangoWe all know that in JavaScript there is a global property named Infinity, and the value of Infinity is 1.797693134862315E+308. We also know that anything bigger than 1.797693134862315E+308 is considered a "bad number", if this is the case then why does my code perfectly fine? Here is my JavaScri...

 
5:51 PM
yo sup
 
user5870134
Hello @taco.
 
mmm mango.
 
user5870134
Haha :D
 
Any relation to Mango Mussolini?
 
user5870134
Nope, thank god.
 
6:29 PM
Go Falcons!
 
7:08 PM
anyone using typescript with istanbul?
 
@taco mmm taco :D
 
:d
 
7:34 PM
anyone have any idea why this doesn't render?
http://codepen.io/wostensen/pen/YNVvLm
 
Hi
is it possible to create a new variable programmatically?
 
@gloriousCatnip I see react errors in console
 
what are everyones favorite civilizations in civ 5
 
@taco I don't get anything up :/
 
7:46 PM
I can't help. React is minified, so the error is useless. Unminify it to debug
 
Don't use minified react
I mean absolutely use it in production, but use the unminified while developing
 
^
 
Do i just remove the .min from the script src in codepen, then?
 
Yeah that should be enough
 
there! :)
but why don't i get anything up in the terminal, tho?
 
7:48 PM
@gloriousCatnip I need to create: fruits = { 'lemon': 1 }
 
I get something
You're using your browser's console right?
Not codepens
 
is eval my only option?
 
@neoDev uhh, eval lol... but I'm sure there might be better ways to construct a context
 
@neoDev What?
 
@meredith oh, haha
i didn't even think about that, sorry :p
 
7:49 PM
:)
 
@FilipDupanović like?
@Meredith I cannot use methods 1 and 2 stackoverflow.com/a/8525249/5638869
 
Are you trying to have like
fruits[fruitName] = 1
 
self[key]; global[`${key}`]; self[do { key + i }]?
dunno if that's all right, but you get the idea
 
@Meredith yes
 
So you want like
createVariable(key, value) and getVariable(key)?
 
7:52 PM
not need getVariable()
only createVariable()
:)
it would be perfect
 
window[key] = value should be what you need
But I question your motivation
 
it is method 1... I cannot do that
I do not have a parent object
 
Method 1 is use eval
Is this node or browser?
 
yes right, methjod 2
browser at the moment, not sure if node in the future
 
Ok let's take a step back
Why are you trying to do this
 
7:54 PM
I already have some declared variables
but I always need to add more
so I want to use a database to extract data and declare variables programmatically
to have:
 fruits = { 'blabla': 'blabla' }
 
So what do you have right now?
fruits = {} & and json file? or what
 
at the moment I have js file with:
const
fruits = { 'blabla': 'blabla' },
fruits2 = { 'blabla': 'blabla' },
...
my database will contain:
column: fruits
blabla, etc...
column: fruits2
blabla, etc...
 
I think I'm missing something
 
@Meredith ?
 
Like the core concept of what you're trying to do
 
8:01 PM
create js variable-name using database-column-name
assign js variable-value using database-column-rows
 
dunno, why not just express this as a function call?
 
@FilipDupanović what do you mean?
var columnName = {
    row0: true,
    row1: true,
    ...
}
I don't jknow how to programmatically generate the columnName variable...
 
I think he quit caring to respond because it rendered once he used a working react js
 
@FilipDupanović why using eval would be bad?
 
anybody know how i can watch the falcons game online
 
8:07 PM
if there are no cons in using eval(), I would do something like:
eval("var variableName = { 'blabla': 'blabla' }");
I'm in node.js
can I proceed?
do you agree with this solution?
 
yeah, I think eval is legit, just wondering if there are different ways to get a dynamic context
 
remote job vs freelancing?
 
usually, it's very easy to do fn(context), fn.call(context)
 
can I eval a json file?
it would be great
 
Uhhhh, what?
 
8:17 PM
you can JSON a json file
 
I want to eval it so I can create programmatically variables. database.json:
{ key: 'ok' }
then
readfile('database.json')
and eval it
is that ok?
 
no
you don't need to eval it
it can lead to great issues later on in your life
 
you want to get key === 'ok' in your code?
 
I want to generate:
var key = 'ok'
etc
 
Object.assign(self, JSON.parse('{"foo": "bar"}'))
 
8:32 PM
can you explain it?
I understand JSON.parse(......etc
but not Object.assign()
and self
var obj = { a: 1 };
var copy = Object.assign({}, obj);
console.log(copy); // { a: 1 }
 
I don't really understand what sort of an environment you really need to get what you would like to do working
 
what is self
 
do you have a snippet of code of what kind of code you'de like to write?
 
not yet
I'm planning it
also I noticed my file will be .js and not .json
var1 = {
    blabla: 'blabla',
    'blabla': blabla,
    ...
}
 
@neoDev You're looking for an AST manipulator
You want to transform JS objects to JS code, yes?
 
8:37 PM
yes
 
any tips about security? are there cons using it?
 
@neoDev Yeah, don't trust user input
But that's always valid.
It's a function that takes objects in certain format, and transforms it into a string that happens to be a valid JS program
As long as you aren't running the resulting code, you have no danger.
 
mmm
I have to allow user input
store into the database.js file
then transform database.js into code
so it can be used as variables (always node.js)
I cannot create whitelists (for validate the user input), as it can be anything
so now I have problems, right? :/
 
@neoDev What problem are you solving?
 
8:50 PM
cognitive bot
 
Meaning?
 
the user input creates new intents
storing them in the database.js
that will be like included in node
so that each intent will be a variable
 
fun fact: pence tweeted more than trump on the vp and potus accounts
 
I have to prevent malicious user input in some way
otherwise they can store even a server destruction
xD
 

« first day (2290 days earlier)      last day (2660 days later) »