Live data from Hacker News

Beam VM Wisdoms (2019)

beam-wisdoms.clau.se

21–30 of 40 posts

Re: Beam VM Wisdoms (2019)

#22
post #5
post #3

Earlier quoted context omitted.

What 5 y.o. wouldn't understand an explanation as simple as this: > This way it is easy to jump to a location in C code which handles next opcode. Just read a void* pointer and do a goto *p. This feature is an extension to C and C++ compilers. This type of VM loop is called direct-threaded dispatch virtual machine loop. ...I guess the author works with quite smart 5 years olds, right...

I mean ELI5 is clearly hyperbolic, but explaining dispatch like "Just read a void* pointer and do a goto *p" is definitely 1st year of CS level. This wouldn't be valid for teaching actual VM implementation fundamentals. Some may wish courses about compilers & VMs would be as easily (and naively) explained, but this style misses a lot of critical and complex details. Nobody likes complexity, but if it exists, it exist…

Most "1st year of CS" people do not know C or understand how pointers work, let alone an 'opcode'

Re: Beam VM Wisdoms (2019)

#23
post #9

There sure has been some definition creep of ELI5...

I guess the first and foremost for an ELI5 is WTF is BEAM VM? The "BEAM VM ELI5" page doesn't explain what it is specifically, and how it's not a Hypervisor VM, but as a bytecode interpreter in Erlang. When I see 'VM' I think first of a hypervisor virtual machine. Maybe I'm a bit of a curmudgeon, but I'd like to think an ELI5 would at least bring in the basics. http://beam-wisdoms.clau.se/en/latest/eli5-vm.html

I think the ELI5 is being used rather loosely and figuratively and in spirit here, which should be clear.

> When I see ‘VM’ I think first of a hypervisor virtual machine.

That’s kind of a strange interpretation to me. In the context of programming languages VM is quite clear ala BEAM VM, CLR, JVM, LLVM, etc.

Re: Beam VM Wisdoms (2019)

#24
post #5

Earlier quoted context omitted.

I mean ELI5 is clearly hyperbolic, but explaining dispatch like "Just read a void* pointer and do a goto *p" is definitely 1st year of CS level. This wouldn't be valid for teaching actual VM implementation fundamentals. Some may wish courses about compilers & VMs would be as easily (and naively) explained, but this style misses a lot of critical and complex details. Nobody likes complexity, but if it exists, it exist…

Most "1st year of CS" people do not know C or understand how pointers work, let alone an 'opcode'

C is not a mandatory subject in first year of CS where you live? At least it used to be where I live, pretty universally (although at that time our universities were in the middle of a Pascal-to-C transition, so as to speak).

Re: Beam VM Wisdoms (2019)

#25
post #8

I thought modern processors had enough branch prediction that threaded interpreters were no longer faster than a normal switch loop. Wonder if that also applies to aarm64

Supposedly, some relevant performance characteristics changed after Spectre mitigations got implemented. I never got around to looking into this, and have no idea how things stand right now...

Re: Beam VM Wisdoms (2019)

#26
post #24

Earlier quoted context omitted.

Most "1st year of CS" people do not know C or understand how pointers work, let alone an 'opcode'

C is not a mandatory subject in first year of CS where you live? At least it used to be where I live, pretty universally (although at that time our universities were in the middle of a Pascal-to-C transition, so as to speak).

I had Ada95 in my introductory classes, and today my alma mater uses Java, I think.

I would estimate many more programs use Java than C.

Re: Beam VM Wisdoms (2019)

#27
post #26
post #24

Earlier quoted context omitted.

C is not a mandatory subject in first year of CS where you live? At least it used to be where I live, pretty universally (although at that time our universities were in the middle of a Pascal-to-C transition, so as to speak).

I had Ada95 in my introductory classes, and today my alma mater uses Java, I think. I would estimate many more programs use Java than C.

We still have C/C++ as a first year subject where I studied, with Java being a second year subject.

Re: Beam VM Wisdoms (2019)

#28
post #9

There sure has been some definition creep of ELI5...

I guess the first and foremost for an ELI5 is WTF is BEAM VM? The "BEAM VM ELI5" page doesn't explain what it is specifically, and how it's not a Hypervisor VM, but as a bytecode interpreter in Erlang. When I see 'VM' I think first of a hypervisor virtual machine. Maybe I'm a bit of a curmudgeon, but I'd like to think an ELI5 would at least bring in the basics. http://beam-wisdoms.clau.se/en/latest/eli5-vm.html

I think the first sentence of the page explains pretty clearly that this an ELI5 of BEAM VM internals, not of what the BEAM VM is.

This is the collection of easy to read (ELI5) articles as well as in-depth knowledge such as VM internals, memory layout, opcodes etc.

Re: Beam VM Wisdoms (2019)

#29
post #27
post #26

Earlier quoted context omitted.

I had Ada95 in my introductory classes, and today my alma mater uses Java, I think. I would estimate many more programs use Java than C.

We still have C/C++ as a first year subject where I studied, with Java being a second year subject.

My alma mater had zero language courses. We were expected to learn enough of whatever languages were necessary for concepts covered in the course. Intro courses used Scheme and Java. C ended up being used in later courses after the intro ones, e.g. operating systems.

Re: Beam VM Wisdoms (2019)

#30

This is quite a deep rabbit hole! Recently I decided to try learning erlang/elixir so reading about the beam vm internal is fascinating even though I barely know the language at all.

Welcome to the BEAM world. It’s a very interesting place, definitely not just another variation on ALGOL.

This list I maintain hasn’t been tested for broken links for a while, but it should still be useful: https://gist.github.com/macintux/6349828

Post reply on HN