ltta
OpenSCAD on the other hand immediately clicked - at least for me as a programmer. I just had to look up the available primitives and combine them to my liking. This totally jibes with my mental model of the thing I want to build and parametrizing your models is pretty easy.
My main gripe with OpenSCAD is that it is missing good features to generate more "organic" shapes, i.e. beveled edges and rounded corners require a lot of work. They are possible (i.e. with Minkowski sums) but the resulting complex shapes quickly bring the engine to its knees.
[1] http://wingolog.org/archives/2011/07/12/static-single-assign...
[2] http://wingolog.org/archives/2014/01/12/a-continuation-passi...
There are several versions of the LLVM Kaleidoscope language tutorial where you build a compiler that supports numeric operations, it is often based on Pratt parsers (at least the official C++ version[1]), but there's a C version on github [2].
In my opinion, you could get pretty far by reading the "Compiler design in C" or "Modern compiler implementation in C" up to the point of optimization and then applying the code generation from kaleidoscope tutorials. LLVM takes care of many optimizations.
[1] http://llvm.org/docs/tutorial/LangImpl1.html [2] https://github.com/benbjohnson/llvm-c-kaleidoscope
The book starts with parsing (I prefer PEG or Pratt parsers for their simplicity (and tool independence) to be honest and skipped some of that chapter) but then goes into semantic analysis, type checking, code generation, optimization passes, even mentions basic type inference.
There is some code online at http://www.cs.princeton.edu/~appel/modern/c/ .
You just have to be aware what happens in the destructor when you manually free an object. Libraries can make knowing this more difficult.
I guess you could build incremental alloc/release pools (even with reuse) or such things but it comes down to being aware of the problem as described and avoiding cascaded releases.
And to be honest this is not a super common problem but it can happen.
If I remember correctly, Python's hashtables are initialized with 8 buckets that are linearly searched and then switched to a real hashtable implementation when grown past that size.
I have worked with the L4 microkernel where sooo much emphasis was put on keeping instruction and data footprints as small as possible every time the kernel is entered in order not to dirty i- and d-caches.
And I have also seen game engine developers do amazing things in this regard. An interesting development in the gaming space is data-oriented-design that deviates from OOP among other things for performance and parallelization. See http://www.slideshare.net/mobile/cellperformance/data-orient... (though I don't agree with the three "lies" mentionened, I do like the data-centric approach).
http://lambda-the-ultimate.org/node/2552
(Although I think the paper has problems and bias)
But there are some other really interesting alternatives that IMO keep with the spirit: Io (io-lang.org), Ioke (defunct now, ioke-lang.org - some awesome ideas IMO) and Squeak which is being actively developed.
I'd recommend checking out some of these, I think you can easily install io via brew on Macs and used to be able to install joke as well. They improve syntax and/or add significant language features.
A lot of the people behind Self went on to work on the JVM JIT and later the Chrome V8 engine. Self produced many influential ideas in the JIT space like polymorphic inline caches and deoptimization and stack rewriting. Some of the papers published by the Self group at UCSB are fascinating.