Ok, so it looks like the only feedback on this was this, leading to this suggested modification. Thoughts on using that suggestion, and thoughts on finalizing the wording?
even if you legally can, just copying every post from here to there isn't good cuz a) that's boring b) codidact isn't supposed to be an SE clone c) why would you do that d) that's boring
Our community has sorta stagnated, we haven't had a challenge in 2 days. Does this happen every year around this time as it's a holiday in the northern hemisphere? Or will I somehow jinx it like I did a few weeks ago.
(the x argument just gives it the variable to use)
this is the Symja fizzbuzz: s="";For(i=1,i<101,i++,If(Mod(i,5)==0,s=s<>"Fizz");If(Mod(i,3)==0,s=s<>"Buzz");If(Mod(i,5)*Mod(i,3)!=0,s=s<>ToString(i));s=s<>"\n");s
so let's say your program is print(5+3). The lexer will create something like [{IDEN: print}, {OPEN: '('}, {NUM:5}, {PLUS:'+'}, {NUM:3}, {CLOSE:')'}], then the parser will create something like {CALL: {name:'print',arguments:[{BINARY:{LEFT:5,OP:'+',RIGHT:3}}]}}
lag again??? :(
Then, finally the evaluator will look at that and call the function print in the global scope with the argument being 5+3. It then recursively calls evaluate, this time calculating 5+3 by using a switch statement (in most cases) to tell that the atoms are numbers and we are adding them. So then the call returns 8 and as a result 8 is printed to the console. Programming languages aren't really that hard to make, as a matter of fact, PPL took only a few weeks to create and (cont.)
it has a few features like for-loops, ifs etc that are delimited via curly braces, the lexer took only 1 day to create. Then I simply wrote code that could determine what kind of operation the program was doing, then sent it to the appropriate function, which could create a tree.
and no not really as I'm doing a machine learning course. But I'll get back to it
you see, we need to be able to construct arrays with "constructors", but it's hard to fill in a variable's properties thing because each property is an object and the this keyword in js seems to refer to something else. Then we need to be able to update some special __content__ property which is referred to when printed or used in operations, and I'm too lazy to do that now
I'll think about transpiling for my next (?) language, but for PPL it's more suitable to evaluate directly instead of converting then evaluating, plus, I'm thinking about adding some interesting feature with complex "import/export" keywords as well as "partial export", "block function import" etc and that's hard to accomplish with transpiling
by the way I wasn't asking what it was, just in response to your question.
it outputs all integers from one to a hundred replacing all multiples of 3 with "fizz", all multiples of 5 with "buzz" and all multiples of 15 with "fizzbuzz"
out of curiosity, how does a language become "famous"? (I don't mean on cgcc only, I mean that thousands, maybe even millions, of people use it around the world) for instance how did Van Rossum get his language to become so popular?
so if PPL becomes a language that can feasibly solve hard tasks, and I say "USE IT" while holding a sharp weapon, hundreds of thousands of people will use it?
@AviFS that's actually different. They send demos to record labels and they decide they are good so they sign the artists, and they push their music onto the world.
Most Unicode characters have full names, for example ” is "RIGHT DOUBLE QUOTATION MARK". You can find a useful reference here, just type in the character you want to find the full name of and look in the DESCRIPTION column.
Your challenge is to write a program or function that outputs itself as a...