2 ms·
Worse is NOT Better; use a safe and high-performance programming language and learn its foreign-function interface to call out to C and C++. Life is too short f
by mahmud 18y ago
Worse is NOT Better; use a safe and high-performance programming language and learn its foreign-function interface to call out to C and C++. Life is too short for core-dumps and premature optimization, plus you only have two feet to shoot at.
The better designed a language the better its development process feels. You can get immersed in a lowly Lisp, J, or Forth listener. Just a little black xterm with nothing else to it, and you feel productive already (never mind the amazing environments there are for Lisp.) BADLY designed and malignant languages have 3rd party tools to augment its functionality. There are things to bolt on, hammer in and stuff to bake into the scaffolding before you stuff in boxes. The C and C++ equivalent of a listener is `cat` or maybe the system-shipped vi or nano or pico. Can you seriously feel yourself getting something done?*
* (I will answer myself and say yes; I learned Unix programming over a serial line, but it was not an immersive experience; I had books on my desk and lap and was flipping back and forth to get anything done; a masochistic sort of fun, fueled by the mischievous possibility of breaking into another account ;-)
- derwiki 18y agoI didn't really mean for this to be a battle of which language is better, although I prefer not to use a screwdriver for a nail -- I'm doing systems level/kernel programming, so C makes a lot of sense.
- mahmud 18y agoPoint taken. Although I personally don't see C as "another" programming language, more like a system building-block, closer to a portable processor binary format :-) When I wrote kernel modules I used C; today I'm writing an in-memory cache for a mulithreaded webserver. It has to maintain user-sesions in memory across several load-balancing servers. It has a multi-stage storage system. It has a queue manager that maintains a private queue for all concurrent users of the system; everything dynamically scheduled in realtime with a bunch of matrix munching algorithms. Allot of intricate stuff that I would have written in C when I didn't know better. I would still write C code though, but only if I absolutely must, as in your case. Regards.
- kmavm 18y agoSince you mention core dumps, please take some unsolicited feedback from an old C programmer: the post-modern "developer productivity" family of languages' lack of core dumps is a bug, not a feature. You want core dumps. They're the right thing. They let you debug a broken program that has since been restarted, or on a different machine than the crash happened, six months afterwards. Even if you program in a safe language, you still want assert(), and when that assert fails, you don't want an exception: once the exception has torn down a single frame it's too late, since you lose the precious "can't happen" program state. Sure, C is a low-level language, but I think the YC consensus insufficiently weights the quality of tools supporting this ecosystem. Debuggers and profilers are indispensable, high-leverage tools for saving developer time, and the hip languages these days have followed perl's lead in just sticking -d and -p flags in the reference implementation and pretending the problem is solved.
- mahmud 18y ago"the post-modern "developer productivity" family of languages' lack of core dumps is a bug" Lisp doesn't dump core, it will drop you in a debugger prompt where you can Frankenstein your programmer to life as you wish. Forget Lisp, Scheme and other languages with full continuations will give you the entire run trace of your program in a video tape, where you rewind and fast-forward as you wish. C is not a language whose control semantics you want to brag about. But back to Lisp, here how you "dump core" in Common Lisp: write a handler for the error condition and call SAVE-LISP from there. One line of code, left optional to the programmer. "you still want assert(), and when that assert fails, you don't want an exception" Yeah, it's called by the exact same name in Common Lisp. "Debuggers and profilers are indispensable" My Common Lisp has both a deterministic and an statical profiler. Standard Common Lisp has GC, TRACE, ROOM, DESCRIBE, APROPOS, ED, DISASSEMBLE and TIME among others. Those correspond to malloc/free, gprof, ltrace, man, apropos, vim and objdump; in the friken LANGUAGE :-) Everything is tied together with function called semantics and a memory visible to all; not with brittle "shell" languages and text parsing. The vendor and community extensions will make you weep. There is really no point of comparing Lisp to C; you should compare Lisp to Unix.
- kmavm 18y ago