It says none in the reference, which is wrong, so I'm posting it here in hopes the author might fix it.
Edit:
Found a bunch more things they got wrong.
* Bit operations: It says "none", but it's present in Lua 5.3 and LuaJIT.
* Hex literals are prefixed with 0x
* String capitalization is used with string.upper, but it says "none".
* Arrays as function arguments is table.unpack(t), or just unpack(t), depending on the Lua version.
* Iterate over range is for i=1,100 do --[[ code here ]] end
* The dictionary size example uses a loop, when you simply could have used #d
* Sort by values is table.sort
* Command line options are ...
... Anyway, I have to go. There are way more errors in this, with regards to Lua anyway. I wouldn't use this reference.
Add closures to the list. Also, I thought it's really strange that scripting languages 1 and 2 have different tables. Even if the tables were complete and accurate, can't compare javascript and lua because the rows are different.
Can we have an IDE that let's us use our favourite syntax with other languages, please? Auto-correct, suggest syntax, advise on proper usage/best practice/pitfalls in target language.
We already have autocomplete, stubs, and smart guessing which library I might need to include. People probably repeat the same typical mistakes thousands of times each day as they transition between languages. So just allow us to use fundamental programming concepts and take care of the details for me!
If we were able to use our syntax of choice, and "reformat" existing code to our preference, we would probably all be much more inclined to move on to newer languages and thus advancing the field much faster.
"Looks like you're coming from VBA, remember in this language arrays start at 0..."
Right now all I know for sure is that Haxe offers Haxe -> Python in sourcecode (though an AST would be better, probably), and Haxe offers Haxe -> C++...
Generally, it might make more sense to go from AST to AST then back to source code or something, if you didn't need to see the source code after.
I personally appreciate that different languages have different syntax. In some languages it doesn't matter (because they're so close anyway), but across large gulfs there are non-negligible differences in productivity, IMO. If I need to write lots of regexes and do some small scripting or write something no one will understand later, perl's syntax might shine there, it would be bad (I think) to get into the habit of writing in one syntax or with one syntax when there are better syntaxes that might cut down on writing time for the job... Of course, there is the benefit of cutting down unnecessary writing by using perl INSTEAD of something like Java by using this idea...
I've been writing Go for the last 18 months, and seeing it dissected side-by-side with C [0] is causing some epiphanies that I wouldn't normally get to see in day-to-day programming.
Depending on how ptr is used, escape analysis may place *ptr on the stack. Also note that the terms stack and heap are not directly comparable between languages anyway.
The biggest difference is that you cannot actually force Go to allocate on stack (which is the only important use case in this context), the escape analysis only works for primitive cases, but throw a higher order function into it and it fails.
The stated integer divide-by-zero behavior of golang is incorrect.
Whether the process is sent a SIGFPE or not, from the programmer's experience a x/0 will cause the offending goroutine to panic with a divide by zero runtime error (integer divide by zero) which, unlike a signal, can be recovered.
Rosetta Code is cool, but I've long been looking for a "Rosetta stone" type of tool to show the equivalents of lower level operations in various languages. Recently I found a good resource for matrix operations (http://sebastianraschka.com/Articles/2014_matrix_cheatsheet....). This however covers other topics and languages as well . Another gem to add to my bookmarks :-)
When looking at scripting languages, there's a couple problems.
What does "no encoding" mean, or "constant by convention"? Can I write gibberish UTF32 in PHP and it won't care? Can I modify one of this "by convention" constants without a parsing error?
Could be wrong, but constants are all UPPERCASE by convention in a few different languages, I think that's what that means. I don't think this would break anything, I think it's supposed to make the code easier to read/nicer for handing off code to another developer. I don't use Python, but I have seen it in PHP, Ruby, and Javascript and they don't break there.
PHP handles encoding in a very naughty way. I don't know the origins behind this, I only know that it will produce text in the wrong format at times.
I have had issues where I would try to get some JSON with Japanese text and it will produce some janky unicode that doesn't work. There are work arounds for specifying encoding, but it's contingent upon what version of PHP you are using (I am stuck on 5.3.2 for a legacy, closed sourced app with a custom PHP binary).
> Can I modify one of this "by convention" constants without a parsing error?
Depends on the language. Python does not enforce constants, so you can modify them freely. JavaScript as of the ES5 spec did not enforce constants, but ES6 does. Ruby mostly enforces constants, but there are certain bits of metaprogramming that will allow you to overwrite a constant if you are determined enough.
I remember a similar site with someone who set it up as a "learn a language in a jiffy" where it was set up sequentially instead of a cheat sheet. Had languages like Python and Ruby, can't remember the rest.
I haven't been able to find it, but it was a really useful resource, and I wish I could remember what the name was.
I use this quite often and find it really helpful, thankyou to the founder if you're listening.
It'd be even better if it was wiki-editable so that people can make improvements without having to use git. It would also be great if the language functions used (like strpos) linked to official documentation.
I find it interesting they essentially say 'node.js is a scripting language'. I dont get that. As far as I know, Node.js is a js interpreter with extra system api bindings. How would that make Node.js the language?
this is a good idea, creative commons so it's ok to scrape I think...
I'm interested in using nodejs to replace bash scripting, I loathe doing any kind of logic in bash and I just want to excise it. No maven or gradle for build tools. I'll revisit later.
Good domain name as well, easy to memorize, good job.
Edit:
Found a bunch more things they got wrong.
... Anyway, I have to go. There are way more errors in this, with regards to Lua anyway. I wouldn't use this reference.