Reputation
16,311
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
1 41 64
Newest
 Guru
Impact
~224k people reached

Jul
25
comment What should JITed bytecode do exactly?
The last point cannot be overstated. All of these libraries take code that's almost at the level of machine code, and turn it into actual machine code. The tricky part in compiling most languages that are called "scripting languages" is getting from the dynamically typed, late-bound, huge, complicated source language to something that is even remotely efficient.
Jul
25
comment What should JITed bytecode do exactly?
@JörgWMittag Perhaps some Forth programs are faster than a C program that you spent the same amount of time writing and optimizing, but often faster than hand-optimized C? You'll excuse me if I am massively skeptical. In fact, if I didn't associate your user name with quite a few good answers, I'd simply dismiss this as yet another instance of the flat-out wrong propaganda that plagues programming language advocacy.
Jul
25
comment What should JITed bytecode do exactly?
FYI the second is called threaded code.
Jul
23
awarded  Guru
Jul
21
comment Error handling in math library functions
If 0 is a meaningful default value, then that is independent of the specific numeric type. Conversely, if semantically zero does not make sense as fallback, the IEEE float 0.0 is not a good value to return.
Jul
20
awarded  Good Answer
Jul
20
comment rand() gives same numbers again for a small range
@Dorus You still need to generate and store the entire list though. In most cases where shuffling the entire list is prohibitive, that's already a dealbreaker.
Jul
20
awarded  Nice Answer
Jul
20
revised rand() gives same numbers again for a small range
added 12 characters in body
Jul
20
answered rand() gives same numbers again for a small range
Jul
16
answered Is async keyword an ultimate replacement for asyncio module?
Jul
13
comment Is there any programming language(s) which has mathematical number types?
@SimonB You seem to confuse cardinality with well-ordering or something related to it. A countable set has a bijection with the naturals, but there is no requirement that this mapping preserves order (or that there even is such a thing as an "order"). The rationals are countable, for example, even though there is yet another rational between any two rationals.
Jul
12
comment When writing a math library, will operator overloading maintain OOP?
@Ixrec That is a different operation though. Your code does ((A + B) * C) + E, OP's method example does A + (B * (C + E)).
Jul
12
comment Banning zero-argument functions — what problems could it cause in a hypothetical language?
I see. But with this function call syntax, a better option is to go all the way with currying. Then no separate function is necessary and it becomes more consistent that binding the only remaining parameter calls the function.
Jul
12
comment Is there any programming language(s) which has mathematical number types?
@nawfal Just the names is a strange requirement. In particular for your favorite approximation of reals, names like "float" or "double" or "decimal" are good, I'd argue, even for beginners, because they make very clear that there are not the real numbers (and unlike integers for example, the differences are easy to hit even without overflow). As for uncountability: In short, there is no way to list all reals - any list, even infinite, must necessarily miss most of them. More technically, there is no one-to-one mapping from the natural numbers to the reals. See Cantor's diagonal argument.
Jul
12
comment Banning zero-argument functions — what problems could it cause in a hypothetical language?
I don't quite follow the part about parameter binding. If f is a function T -> U, then f x doesn't just bind a value to the first parameter, it calls the function, because now all arguments are supplied. This is what several functional languages do. In fact, it is the only reasonable course of action that I can imagine with that function call syntax.
Jul
12
comment Banning zero-argument functions — what problems could it cause in a hypothetical language?
Isn't this exactly what Haskell does? Well, except that variable = expression defines an unchangeable binding rather than assigning to a variable.
Jul
11
answered Is there any programming language(s) which has mathematical number types?
Jul
11
revised Why does Python need both a compiler and an interpreter?
added 25 characters in body
Jul
11
answered Why does Python need both a compiler and an interpreter?