Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
gf000
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
121.
▲
by
gf000
3mo ago
On the allocation happy path there is literally less work in case of Java. Like at least try to get what I'm saying and argue with that - I'm not saying that Java is faster or whatever, but that it has chosen different tradeoffs
122.
▲
by
gf000
3mo ago
What "work" do we do needlessly? It's a pointer bump. With reclamation being no work. Comparatively a malloc call will have to do extra work to defragment. Also, a stack is not a separate hardware element of the RAM, it'
123.
▲
by
gf000
3mo ago
Memory is memory, stack is not a unique hardware element. It just tends to be hot, but so can certain part of "the heap". Of course this is a toy example, but were the compiler not smart enough (it is surely smart enough in this c
124.
▲
by
gf000
3mo ago
Well, Minecraft sold far more and it's a scratch built 3d engine isn't it? Popularity is certainly not a technical achievement.
125.
▲
by
gf000
3mo ago
Java doesn't mandate the usage of a heap - it can in certain cases avoid doing so and allocate on the stack (escape analysis). Besides, as mentioned java's allocations are much closer to something like using an arena in a low-leve
126.
▲
by
gf000
3mo ago
So can you in binary! And that's more of a library ergonomics question how nice it is. There are plenty of other languages with nice ASTs and `eval`, and that's the only ingredient you need.
127.
▲
by
gf000
3mo ago
eval(parse(yourString)) No it doesn't
128.
▲
by
gf000
3mo ago
How is that different from other languages that have proper repls? Lisps don't really give you much here, if the language can parse itself and can eval it, you have the sufficient primitives. What helps is how "small" the hot
129.
▲
by
gf000
3mo ago
But this is just not true. An utf8 string is most definitely not a bunch of cons cells. Having a one-to-one correspondence is not the same thing, and one might argue that a rust code snippet and the corresponding AST object is just as arb
130.
▲
by
gf000
3mo ago
Well, then ad absurdum it would be easier to just output a bunch of 0s and 1s, right? The same goes for "just a list of nested lists", sure it is easy to produce it, and for trivial examples it may actually be easy, but for more c
131.
▲
by
gf000
3mo ago
Given a new context, why couldn't the same model have a decent shot at reviewing some results? It's not like they identify whether this output is from them and then go "yeah correct", that's not how they work.
132.
▲
by
gf000
3mo ago
Well, my main point is not to never use macros, but that in certain cases a language-native feature that can also solve a problem you would use a macro for, it's probably better (better debugging, error messages, etc). And my other poi
133.
▲
by
gf000
3mo ago
Well, I was talking about the fundamental part. Of course you can have more practical implementations, like Scala or rust's macro system, that gives you a proper typed AST.
134.
▲
by
gf000
3mo ago
I mentioned in other comment that homoiconicity doesn't necessarily make writing macros simpler. It makes writing trivial toy examples simpler. But let's compare it to a modern macro system like rust's or scala's, where
135.
▲
by
gf000
3mo ago
I would argue the functional bias when you have so much mutability. Also, only the first one is remotely unique.
136.
▲
by
gf000
3mo ago
Thank you for the reply, and I definitely agree with you on many points. I absolutely don't want to take away from Lisp that it is somehow uniquely elegant, and does have a mathematical beauty to it, this is certain. I just feel this (
137.
▲
by
gf000
3mo ago
My issue is that a language is just as much about what it disallows , as much as about what it allows. It's absolutely trivial to allow everything , you just have to make a Turing-complete extension either by design or accidentally.
138.
▲
by
gf000
3mo ago
And that's just syntax, it doesn't give you a programming language at all. JS is a dynamically typed language with prototypical inheritance objects that work like universal key-value maps for the most part. It is also mutable. Clo
139.
▲
by
gf000
3mo ago
Well, if we have a compiler that sees a constant value, it can completely optimize out one branch. But it of course depends on the semantics of the language. But yeah you are right in case of a naive compiler.
140.
▲
by
gf000
3mo ago
Well, maybe because digital is better at showing small differences in this case? Like on a 50kmh road, dropping below 50 is quite noticeable in digital, less so with a line above or below another line. But for the revs, I think it's qu
141.
▲
by
gf000
3mo ago
There are plenty of languages with macros though, nothing special about lisps. And no, language semantics absolutely don't compose. Like you can't just do some kind of optimization in one place if you do some mutation on it in ano
142.
▲
by
gf000
3mo ago
Well, compilers have layers - you ain't outputting assembly from the AST layer directly, usually there is some kind of IR. Like LLVM have plenty of layers. And for a simple DSL you can usually just use a sufficiently expressive languag
143.
▲
by
gf000
3mo ago
So then what it is? Because otherwise it's a magical nothing-term to which everything lisp people like applies, but no criticism can ever reach it because "that's not really lisp, see it's different in this other impleme
144.
▲
by
gf000
3mo ago
At the same time, you get a mushy tree as input, instead of a properly typed AST "object" with accessible "function name", "method parameters" everything that you can just refer to. It will be the third argumen
145.
▲
by
gf000
3mo ago
Well, as mentioned that's why you create two lambdas as the branches. This is pretty much what thunks are in some languages (like Haskell), so this example doesn't strictly require macros per se.
146.
▲
by
gf000
3mo ago
Can you expand on that? I am mildly experienced with Clojure, and much more so with the JVM and I see no reason for that to happen (besides perhaps some kind of module shenanigans or importing stuff that requires special flags?)
147.
▲
by
gf000
3mo ago
Can you parse code into an in-memory representation and can you eval? If yes, then you can do everything that Lisp repls can. The parser being slightly more complex than parsing s-expressions doesn't materially change anything.
148.
▲
by
gf000
3mo ago
Why do you think other people who have fallen in love with, say, Ruby, are less experienced in other languages? They just have less of a cult.
149.
▲
by
gf000
3mo ago
What idea? S-expressions? Because that's all these languages share. What's common in CL and Clojure? They are as dissimilar as C and Scala.
150.
▲
by
gf000
3mo ago
If you squint enough, JS is a lisp.. Define a goddamn language, syntax is not enough to define one! What are the semantics? Without that you are just talking about syntax trees like they would mean anything
More ›