Dynamic languages will allow a range of types through functions. JITs add tracing and attempt to specialize the functions based on the observed types at runtime. It is possible that later on, the function is called with different types than what the JIT observed and compiled code for. To handle this, JITs will have stubs and guards. You check the observed type at runtime before calling the JITted code. If the type does not match, you would call a stub to generate the correct machine code, or you could just call into the interpreter slow path.
An example might be the plus operator. Many languages will allow integers, floats, strings and more on either side of the operator. The JIT likely will see mostly integers and optimize the functions call for integer math. If later you call the plus operator with two Point classes, then you would fall back to the interpreter.
I’m currently in a part time masters program for fun and taking the compilers course. I’m sure John’s experience is different than mine, but it seems the question should be put to universities. The professor of my course, by his own admission, hasn’t studied compilers other than his undergrad decades ago and as far as I can tell was assigned the course to teach. As a result the syllabus is relatively dates. I think I’m 8 weeks in and we’ve only discussed parsing theory. As far as I can tell there won’t be time for detailed study of code gen, optimizations, type checking, etc.
The first time I read Meditations I read the Gregory Hays translation. It's written with very colloquial language and makes for a great entrance to the book.
There's a weird attack on MBAs for not being good at creating value in tech. But the biggest, most successful new tech companies over the last few years are hardly valuable in the grand scheme of things. Social networks are just new advertising platforms. Sure, there are companies like SpaceX, but I'd imagine the vast majority of people here on HN are not building anything so significant.
Where in Spain? The author of the Typus gem (a Ruby admin tool) lives in / freelances from Barcelona. Your dad may want to reach out to him for tips or advice.
An example might be the plus operator. Many languages will allow integers, floats, strings and more on either side of the operator. The JIT likely will see mostly integers and optimize the functions call for integer math. If later you call the plus operator with two Point classes, then you would fall back to the interpreter.
reply