I don't think that's correct for Python!
Also, which "many other" languages have only doubles, aside from JavaScript?
[1] https://docs.python.org/3/reference/datamodel.html#the-stand...
I don't think this is true of most languages; only for Lua that I know of. And it causes problem: if you send a 64-bit ID to Lua, which represents it as a double, it will subtly change the last few bits. Then when you go to look up something with that ID, you get the wrong item.
Most languages don't have that problem.
$ echo 'puts [expr 2 ** 128 + 1]' | tclsh
340282366920938463463374607431768211457
$ python3 -c 'print(2 ** 128 + 1)'
340282366920938463463374607431768211457
$ node -p 'Math.pow(2, 128) + 1'
3.402823669209385e+38Anyway, java does not have unsigned int, so there you go.
Edit: if he claims that int-is-float like in javascript, he’s just flat wrong.
No, it’s not. In the base language Python has an int type that is separate from its float type.
See numbers.Integral and numbers.Real
---
> The folks at Rust tried to do a decent job of fitting macros in the language.
> Other languages, like all of the Lisp family, managed to fit them in more gracefully, but they had a way of defining syntax where the syntax was almost entirely free of semantics. And in most languages, syntax and semantics kind of go hand in hand.maybe to support semantics "this is an if statement" could be some kind of metadata on the macro i suppose?
> (and a b c)
> (and* a b c)
Can you tell by looking that the the first is a macro and the second is a function? The first short circuits and evaluates only the argument forms it needs and the second always evaluates all three. That's a big difference, and not at all obvious from the syntax. In fact, it's hidden by the syntax, because the syntax is exactly the same for each.
Macros are part of the power of Lisp, but they change the normal rules of evaluation (the semantics) in ways that are not necessarily obvious unless you know the specific definitions behind each symbol in function position.
This is the TXR Lisp interactive listener of TXR 268.
Quit with :quit or Ctrl-D on an empty line. Ctrl-X ? for cheatsheet.
1> (special-operator-p 'and)
t
2> (fboundp 'and)
t
3> (fun and)
#<intrinsic fun: 0 param + variadic>
4> (and 23 nil (prinl 42))
nil
5> (call 'and 23 nil (prinl 42))
42
nil
6> [and 23 nil (prinl 42)]
42
nil
7> [mapcar if '(nil t t nil) '(1 2 3 4) '(a b c d)]
(a 2 3 d)
8> (if t (prinl 'true) (prinl 'false))
true
true
9> [if t (prinl 'true) (prinl 'false)]
true
false
true
If we use the functional brackets, all arguments are evaluated the same way, and the leftmost value is treated as a callable object applied to the remaining values.A symbol in the leftmost position of [...] is never treated as a macro (other than symbol macro) or special operator, even if it has a such a binding.
For me this was the biggest challenge when I was introduced to lisp: everything is just a list. Powerful, yes, but in other languages the ground felt firmer underneath my feet when I knew a class was a class, a struct was a struct, and array was an array, all with their own unique syntax. In lisp everything just looks the exact same. That is part of why it is so powerful, but at the cost of semantical references that can help users understand a lisp program.
Don't get me wrong I HATE Java on Android and everything GUI related, but I'm don't think Java will be replaced anytime soon.
That Erlang forces some synchronization that other languages may not does not affect the ability to (with versions of Erlang since, what, 2007 or 2008?) make use of SMP for simultaneous execution of processes on separate cores or processors.
See also OpenMPI for an example of a distributed programming system that also can't share memory without copying it. Though in its case it was across physical nodes (and so the need to communicate was more obvious, they physically didn't share memory anyways). Still true parallelism.
Being explicit about the data being passed around while defaulting to “not shared” has benefits for making use of all your cores more efficiently.
It seems that James Goslings view of "true parallelism" is "let you take advantage of multiple processors", so with that frame of mind, Erlang does give you "true parallelism".
> Coroutines kind of magically sidestep some of the naughty issues in true parallelism. And for me, one of the problems with coroutines, which is why I haven't used them in a long time, is that they don't actually let you do or let you take advantage of multiple processors. You can't do true parallelism.
> But as soon as you've got one of these coroutine-based languages and you try to exploit multiple processors, if you're doing a lot of coroutine-type operations and you don't have enough processors, you're just saturating one processor.
The other debate is on how parallelism (and concurrency) should be done. Shared-nothing or shared-memory? It'd be foolish to say that only one of them is parallelism, but it would be reasonable to debate the merits of each approach in different systems and circumstances.
Longer quote seems weird as well
> To really get the performance improvements you see, it helps dramatically to have a statically-typed language. For dynamically-typed languages, like Python, it's really, really hard. And often, what people end up doing is adding annotations to the language so that you get languages like TypeScript, which is essentially JavaScript with type annotations. And it's really funny because JavaScript is essentially Java with the type declarations removed. So TypeScript is essentially Java with permuted syntax.
He seems to be saying that TypeScript leads to faster code execution as TypeScript has types, but fails to understand that TypeScript still compiles to JS and the browsers run JS without types, so should have the same performance as just writing JS directly (probably less performance, as TSC adds bunch of wrappers and other unnecessary stuff you would avoid if writing vanilla JS)
I'm not saying this is the case, but isn't there a greater opportunity to optimize TypeScript code over JavaScript due to the presence of types? Isn't this the same thing as a statically typed program being compiled into assembly (untyped) ?
I'm curious how can Eclipse, one of the greatest java projects, be omitted? Then I saw the name of JetBrains at the end of the article, and realized that I just read another soft advertisement.
The last one: https://news.ycombinator.com/item?id=27886575
This is true across the board for engineering. It’s hard to build something that survives long prolonged contact with engineering realities. Computer architectures change. How things are done efficiently changes. The set of trade-offs we choose to make changes as the underlying business shifts or better business models are discovered. And heck, businesses can be cyclical for no better reason than humans are naturally cyclical in trends (see fashion)
I always it was haskell that introduced the term...
I tried to find a copy of this SNOBOL paper from 1973[0] to see whether it occurs there, but no luck so far. It doesn’t appear in the original COMIT paper[1].
"datePublished": "2021-08-06T15:45:40+03:00", "dateModified": "2021-08-06T15:45:40+03:00",
Erlang: "Hold my beer"