Hyperpolyglot
hyperpolyglot.org
hyperpolyglot.org
x > 0 and x or -x
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.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...
Excellent resource.
I saw this and thought that it's just weird and confusing. Why would someone make case-sensitivity a syntax for exports?
// memory allocated on heap:
ptr := new(int)
*ptr = 7
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.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.
- inaccuracies (e.g. word separator in CL depends on current readtable), which is understandable given the very terse format
- missing cases (e.g. no compiler for CL?)
- and factually wrong elements (identifiers are case sensitive, but upcased while reading by default; they can starting with numbers, like 1+, etc.).
Fortunately there is a way to fix that: https://github.com/clarkgrubb/hyperpolyglot/issues
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?
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).
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.
Edit: Nevermind. Found https://github.com/clarkgrubb/hyperpolyglot
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.
Will bookmark this, though.
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.
<?php
$hello_world = 10;
$two = "two";
echo "hello_world = $hello_world\n";
echo "two[1] = {$two[1]}\n";Also, you can always open up a PR on https://github.com/clarkgrubb/hyperpolyglot
http://evincarofautumn.blogspot.com/2012/02/why-concatenativ...
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.
Could just be:
Math.max(...[1, 2, 3])