4 ms·
> While Lisp is a dynamically typed, GCed language, MACLISP let you annotate variables to promise that they would only be called on certain primitive types, thu
by bsder 3y ago
> While Lisp is a dynamically typed, GCed language, MACLISP let you annotate variables to promise that they would only be called on certain primitive types, thus supporting compile-time optimizations for numeric code and not necessarily allocate memory, follow a pointer, unbox data etc.
And woe betide you if you happened to violate the preconditions of one of those annotations. That kind of programming is no better than C with "Segmentation fault. Core dumped."
The problem is that "system programming" or "embedded programming" isn't one thing.
There are people who want to throw around a zillion polygons at 144FPS. There are people who want max performance on x86-64 shoveling around millions of network connections. There are people who need guaranteed real time response or someone dies. There are people who need to stay asleep all the time to conserve battery and only wake up once every 5 minutes to chirp some RF.
These people do not have the same needs in a language yet they almost all wind up shoveled into C.
- ModernMech 3y ago> These people do not have the same needs in a language yet they almost all wind up shoveled into C. Why is that tho? There are better languages for each of those applications. What do you think, is it business requirements? Hardware? Regulation? Legacy code?
- bluGill 3y agoAre there better languages? What does it even mean to be better? C is a great choice because I can hire people who know C and get good results. A domain specific language will not be much better than C for any of the above. It turns out that all the hard problems listed above are similar enough that someone good in one will be good in them all and so I can hire C experts from any field and get going fast without having to teach them my domain specific language that isn't really much better.
- ModernMech 3y agoSo does that mean you feel programming language design peaked in 1972?
- bluGill 3y agoNo. However I think most "modern" languages make a big mistake because they don't address interoperability. Rust is great if you only write in rust, but if you have millions of lines of C++ it is really hard to fix a simple one line of code bug in rust. Rust cannot talk C++ - it can at least talk C but you lose the advantages of rust. Now imagine you have C++, rust, go, and ada teams fighting about which is best - they have to drop down to 1972 C to work with each other. (note that I carefully excluded D since D does have some C++ interoperability) I do not know the best way for any modern language to take to any other modern language - but 1972 C is a big negative to them all.
- pjmlp 3y agoOnly on Linux and regular UNIX systems. On other systems we have XPC, COM, AIDL, TIMI, MSIL.
- bluGill 3y agoTrade offs - I'm not familiar with all of those, but the ones I do know of are trading something for that flexibility - generally performance and power consumption - two things that we should not be willing to trade off. You can get similar things from UNIX as well, though it isn't the default and so you need extra effort to use them. That said I fully accept your correction. (even though it doesn't apply in my world)
- gumby 3y ago> And woe betide you if you happened to violate the preconditions of one of those annotations. Umm, this is MACLISP we're talking about -- you know the types at runtime and can pass the unspecialized argument to an ordinary function. A kind of generic function I suppose, though we didn't use that vocabulary back then. Just because this was 50 years ago doesn't mean that programmers were morons.
- bsder 2y agoThe point of annotations is to avoid having to branch on type at runtime. Consequently, whatever you sent in was assumed to be what the annotation was. There was no "compilation phase" to ensure that the type at the call point actually matched the type in the annotation. If those differed, then your program would just go boom. Now, it could be that I'm remembering something other than MACLISP. It's been a lot of years.
- gumby 2y agoMACLISP was most definitely a compiled language, it’s just that like modern Lisps you could mix the two (compiled and interpreted code). I tried to be clear by using the modern terminology “generic function”. If you compile a function with those annotations you’d end up with two functions: one that could be called if you knew the types at compile time and one that did not.
- bsder 2y agoApparently I am confusing LISPs. My fault.