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…
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,…
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…
Well, Minecraft sold far more and it's a scratch built 3d engine isn't it? Popularity is certainly not a technical achievement.
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…
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.
eval(parse(yourString)) No it doesn't
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"…
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…
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…
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.
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).…
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.
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…
I would argue the functional bias when you have so much mutability. Also, only the first one is remotely unique.
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…
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…
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…
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.
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,…
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…
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…
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…
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 arguments' 2nd…
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.
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…
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,…
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…
Well, Minecraft sold far more and it's a scratch built 3d engine isn't it? Popularity is certainly not a technical achievement.
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…
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.
eval(parse(yourString)) No it doesn't
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"…
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…
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…
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.
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).…
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.
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…
I would argue the functional bias when you have so much mutability. Also, only the first one is remotely unique.
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…
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…
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…
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.
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,…
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…
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…
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…
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 arguments' 2nd…
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.