News for hackers. Stuff that matters.
Re:Essentials of Interpretation by chrisseaton on Wednesday March 11, 2020 @05:49PM (#22551157)
There seems to be a real cottage industry of how-to-write-interpreters/compilers at the moment - Writing an Interpreter/Compiler in Go, Crafting Interpreters, this, etc.
Re:Essentials of Interpretation by DmitrySoshnikov on Wednesday March 11, 2020 @06:08PM (#22551339)
Yes, I agree, the topic is becoming pretty hot these days, and this reflects the era of transpilers, WebAssembly, coming into play with its nested bytecode format, and other related topics. More people are getting interested in how things work under the hood, instead of just "using" a language.
Re:Essentials of Interpretation by codetrotter on Wednesday March 11, 2020 @07:05PM (#22551762)
Hey, I enrolled in your previous Udemy course about garbage collection last year and while I did not yet finish watching all of the videos I did watch quite a few of them.

So first of all, thank you for creating that course about garbage collection. The videos that I've watched from it so far were interesting and informative to me. (I've completed 71% according to Udemy but I must admit that I sometimes watched videos as I was going to bed and may not have been fully attentive at all times.)

Secondly, a small suggestion for improvement based on the first course: Since each piece is relatively short, it quickly becomes quite tiring that each and every video begins with a ~15 second long intro animation, most of which is just repeating the title of the course. I would skip that all together and make the transition 2 seconds long at most. Just enough to read what the topic of the current video is.

Re:Essentials of Interpretation by DmitrySoshnikov on Wednesday March 11, 2020 @07:30PM (#22551926)
Thanks for your feedback, appreciated! And glad the Garbage Collectors class is interesting. Yes, I'll consider shortening the intro in the future classes. Initially each lecture was a self-contained, and potentially with no related context to previous lectures, however when combined in a class, yes, it makes sense to make the intro shorter. In the Interpreters class I shortened it to ~5 secs only.
Re:Essentials of Interpretation by wool_gather on Wednesday March 11, 2020 @07:00PM (#22551720)
Absolutely, and it's fantastic! It's the most fun I've had with my computer since my first "Hello world".
Re:Essentials of Interpretation by mhh__ on Wednesday March 11, 2020 @11:26PM (#22553409)
I think it's people realising that compilers aren't that complicated until you get into the backend.

Lots of optimization passes, even, are relatively obvious (not necessarily trivial, but they make sense) - to my eye at least, the Voodoo magic is in the scheduling and code generation

Re:Essentials of Interpretation by DmitrySoshnikov on Saturday March 14, 2020 @07:18PM (#22579524)
> the Voodoo magic is in the scheduling and code generation

Yes, for the code generation one needs to well understand semantics of the target language. And when it's a low-level language (Assembly), the "voodoo magic" mainly relates to generic understanding of the lower-level architectures. However, there might be compilation to another high-level language (in case of a transpiler), and by itself code generation at this stage is not that hard, simply because a target language is more understood in this case.

Instruction selection topic, and where to place the data -- on the stack, or into registers (and how a register allocator works) also mainly relates to the lower-level.

> until you get into the backend

Yes, and that's why I think it should be a separate class, specifically for higher-level compilation, and a low-level compilation.

We'll be covering this in "Essentials of Compilation".

Re:Essentials of Interpretation by seanmcdirmid on Thursday March 12, 2020 @12:08AM (#22553681)
With something like the dynamic language runtime, even code generation can be easy. Too bad it hasn’t been copied on other platforms outside of .NET.
Re:Essentials of Interpretation by chrisseaton on Thursday March 12, 2020 @05:25AM (#22555097)
What does .NET do to make code generation easy?
Re:Essentials of Interpretation by seanmcdirmid on Thursday March 12, 2020 @09:58AM (#22556892)
The DLR as I mentioned is an API for dynamic code generation that hooks into the platform’s JIT. The code you can generate with it runs fairly fast (as fast as other JITTed code)
Re:Essentials of Interpretation by chrisseaton on Thursday March 12, 2020 @11:38AM (#22557948)
Do you mean just generating bytecode through an API? That's a completely trivial problem in the first place - just linearise your AST. When people talk about 'code generation' they mean the complexity of native instruction scheduling and selection.

And if you want to just generate byetecode doesn't Truffle on Java do that far better than DLR? Truffle seemed to actually achieve what DLR promised but never really managed - genuine support for dynamic languages on .NET/JVM.

Re:Essentials of Interpretation by seanmcdirmid on Thursday March 12, 2020 @12:11PM (#22558276)
The DLR had two parts: support for dynamic languages, and a strongly typed API for generating expression trees at run time. The second component is the one that survived and is fairly robust. It is quick, skipping the bytecode stage completely, and is fully typed.