7 ms·
Letter to a Young PL Enthusiast
- speek 16y agoThis is inspiring to me, as a young computer scientist. Maybe I'll go off to create my own language and OS.
- pwpwp 16y agoThanks! Comments like this make blogging even more worthwhile. And go for it. There's no better way to learn CS.
- nostrademons 16y agoBe aware that it is a giant rathole. If you're looking for something commercially viable that might actually make a difference in the world, you're better off in a field like information retrieval, machine learning, geo, or image/audio processing. There seems to be a siren's call of language/OS/editor development, though. If you really can't resist it, go do it. At the very least, you'll learn a lot, and it beats CRUDscreen Web2.0 apps as a mental exercise. But other fields of CS are much, much, more useful.
- speek 16y agoI'm a systems guy who happens to be obsessed with biologically-inspired machine learning stuff. There's just something about my genetic makeup that makes me love PL/OSes, though they're more of a means to an end than anything else.
- FraaJad 16y agoIn your opinion, what languages have the best return on investment when it comes to IR, ML and related data sciences?
- nostrademons 16y agoIn my opinion, languages don't matter as much as the underlying algorithms. Learn the math, and then you can implement them in any language. ...but if you had to choose, I'd say to learn Python so you can prototype quickly, and then C++ so you can make it run fast in production. The two also have the nice benefit of working quite well together, so that you can push things into the C++ layer as you understand them better, and keep experimenting by gluing together those libraries with Python.
- dedward 16y agoAnd we used to say prototype in C++ and then re-implement in C to make it fast in production. The math and the algorithms are important - but one shouldn't dismiss a fundamental understanding of the lower levels of the system - even though they'll change over time and you probably won't have to "go there". Real-world software runs on real-world systems, and there is no reason for a budding computer scientist to deprive himself of at least a cursory understanding of how things work underneath - you never know when he'll want to break out of the toolset Vendor X provides him and do something radical and new (like implement something in hardware, or recognizing there is some feature there he can use to massive real-world benefit)
- mdon 16y agoKind of funny that the only negative listed for C# is "(it) hails from the evil Northwest." A backhanded way of saying C# is really nice.
- pwpwp 16y agoYou are right. C# is a cool language, especially v4.0, and originally, I wanted to add that to the post.
- thunk 16y agoIt's odd that he dismisses most existing Lisps, then advises the reader to create their own. I wasn't sure if he meant it pedagogically or pragmatically or both.
- pwpwp 16y agoGood question. I think that the crux is that if you're enthusiastic about PLs, you have to create your own or be enslaved by another man's. That's my feeling at least. And on the way to creating your own PL, you'll also learn to appreciate the existing PLs and implementations better, and learn to live with them, warts and all.
- thunk 16y agoGotcha. And an influx of new and experimental Lisps is always welcome.
- pwpwp 16y agoRight on :)
- skybrian 16y agoI can see it as purely an academic exercise. But what good is inventing a language that nobody else knows? How do we communicate? How do we share code? Languages are important to the extent that people decide to learn them and use them, and that way lies politics.
- pwpwp 16y agoSome people, like me, simply can't not create PLs. This post is for them. Politics doesn't even enter the picture.
- jules 16y ago> Ignore the siren calls of the virtual machines. You have to be the master of your domain. Use C or assembler to implemente your language. The free Unices are your friends. Learne about the internals of your operating system, how it compiles, links, loads, and runs executables, the fruits of your labor. Learn about calling conventions, system calls, and the god-given hierarchy of the memory. Might want to skip the low level stuff and quickly get to business with high level libraries like the Dynamic Language Runtime.
- pwpwp 16y agoSure. But IME, somewhat paradoxically, the lower you go, the more freedom you gain. Not to speak of understanding.
- jules 16y agoTrue, but if you have a great idea for a new language you really don't want to spend years implementing your own code generator, garbage collector, runtime system and standard library; you want to get a useful language as quickly as possible. As an educational experience doing everything yourself from the machine code layer up is great, but for getting stuff off the ground it's not.
- pwpwp 16y agoI don't know, a new language will take you years anyway until its useful. And it's a very cool hobby, so I'm not even interested in getting it done as quickly as possible. ;) I want to make it as good as I can. And I get a warm fuzzy feeling from doing stuff myself (although I'll use the Boehm GC and compile to C for my next language).
- chc 16y agoHow confident are you that a novice language designer will be able to do better cross-platform codegen than LLVM?
- teaspoon 16y agoQuestion from someone who maybe doesn't spend enough time examining PLs: How is JavaScript "like assembler with hashtables"? What "messed-up-ness" are Python and Ruby legendary for?
- mhansen 16y agoIt's not really assembler with hashtables, at all. It's got closures FFS. However the hashtables are broken: they say they're empty, but they have 'constructor' as a key when you create them.
- pwpwp 16y agoFirst, you should take the whole post with more than a grain of salt. ;) Re JavaScript, I'm referring to the lowlevel nature of many of its constructs: - its impoverished way to pass parameters (i.e. there are no keyword parameters; you don't get an error if you pass too many or too few arguments) - its impoverished exception handling (i.e. you can't catch exceptions of a specified type) - its impoverished standard library and built-in data structures - its lowlevel and complicated OOP system There's more, see http://pwpwp.blogspot.com/2009/08/awesome-helma-and-lacking-javascript.html http://pwpwp.blogspot.com/2009/08/awesome-helma-and-lacking-... Re Python and Ruby, I'm mostly referring to the fact that both languages started out with broken lexical scoping, and had to change their scoping rules repeatedly, which is a huge red warning sign. Additionally, it seems very hard to implement both languages so that they run fast, another factor. Ruby also has an array of different kinds of first-class functions (blocks, procs, lambdas, I lost track), with different capabilities and restrictions, which is a design failure to me. That said, I think they're acceptable languages, even if they force you to memorize a lot of irrelevant stuff.
- nostrademons 16y agoJavaScript has a certain elegance to the minimalism, though, much like Scheme: - You can emulate keyword parameters by passing an 'options' dict, and you can emulate defaults by 'var myOpt = options.myOpt || default". You can also define a function, like $.extend, to do this for you. - You can catch exceptions of a specified type by checking the type and rethrowing if it's not appropriate. And you can define a function to do this for you: function try_catch_if(exc_type, body, exc_handler) { try { body(); } catch (e) { if (e instanceof exc_type) { exc_handler(); } else { throw e; } } } - You can define your own standard library a la JQuery or YUI, or even modify the built-in one a la Prototype (though I don't recommend this). And the built-in data structures aren't all that bad. - You can build whatever OOP system you want on top of prototypes, and many libraries do just that. (In this respect, it's quite similar to Scheme, where every programmer starts by defining his own incompatible object system). Most of the sucky parts of JavaScript come from it introducing things that weren't really thought through, eg. the 'this' keyword nonsense is ridiculous, as is the lack of argument-checking by default.
- j_baker 16y agoThis is a decently thought-out article, but it's important to remember that programming language design is as much an art as any other form of programming if not moreso.
- kabdib 16y agoWrite the debugger first. You'll need it anyway. And it will provide /much/ insight into your mistakes.
- aerique 16y agoFunny, I don't understand the only one that sort of applies to me: "Syntax is the Maya of programming".
- rntz 16y agohttp://en.wikipedia.org/wiki/Maya_(illusion) http://en.wikipedia.org/wiki/Maya_(illusion) I'm not sure which part you didn't understand; this is my best guess. I believe the author is trying to say that syntax is a superficial appearance, and not relevant to - indeed, a distraction from - understanding the true beauty or ugliness, utility or disutility, of the concepts embodied in a language.
- aerique 16y agoAt first I didn't understand the whole paragraph (I had just woken up :-) ) and then it was just the Maya part. I didn't understand his use of Maya. Thanks for the explanation. It seems the author and I have got a similar view on syntax (how can we not since we both seems to admire Alan Perlis!).
- kunjaan 16y ago"Syntax is the Viet Nam of programming languages" - Matthias Felleisen.
- gruseom 16y agoWell now, this gem was unexpected: you must create a programming language, or be enslav'd by another man's. William Blake allusion FTW! Nothing at all is lost.
- arethuza 16y agoThe original is: "I must Create a System, or be enslav'd by another Man's; I will not Reason and Compare: my business is to Create" From "Jerusalem The Emanation of The Giant Albion": http://www.blakearchive.org/exist/blake/archive/work.xq?workid=jerusalem&java=no http://www.blakearchive.org/exist/blake/archive/work.xq?work...