8 ms·
As a mild counterpoint, I'm anything but upset with the recent additions to Java. It feels like it's becoming a simpler language, as in many cases, it takes muc
by Twisol 4y ago
As a mild counterpoint, I'm anything but upset with the recent additions to Java. It feels like it's becoming a simpler language, as in many cases, it takes much less effort to tell the compiler what I want to say. The conceptual tools Java provided at its inception just weren't enough to express things well.
In a similar way, even though the lambda calculus, SKI combinator calculus, or and MOV-only assembly are minimal in very real ways, the cognitive burden of expressing yourself in these languages is very, very high!
To pick a friendlier example, I'm a big fan of Lua. Lua is deeply minimalist, and from what I know, its developers try hard to keep its feature set orthogonal (and it has my favorite language feature, coroutines!). It's a great fit for certain domains. Nonetheless, it's not a great fit for most domains; for instance, I never got the sense that it could scale much beyond one-person projects.
General-purpose computing languages are in a bit of a catch-22. People need to do such wildly varying things with them, that in order to be minimalist, they must necessarily put some distance between the features they provide and the use-cases they are applied to. Conversely, to be expressive, they must minimize the amount of encoding required to take ideas in the problem domain and represent them in the language.
A domain-specific language (with high expressivity for the problem domain) invariably tends to take on general-purpose features, as users' needs expand and they push the language to its limits. A general-purpose language (with low expressivity for most problem domains) tends to take on more and more high-level features, to help bridge the gap between the language and the domains it is most often put to use in.
I think a polyglot environment makes a lot of sense. Use high-expressivity DSLs to serve your business logic, and high-generality languages to serve those DSLs. In some ways, that's the ideal of Lisp: your DSLs are indistinguishable from the host language itself, so the experience is seamless. But folks don't seem keen on polyglot environments, Lisp or not. So we're at an impasse.
- Rochus 4y agoLua 5.1 is the most amazing language design I've ever come across; you can do almost anything with this language and it's as minimal as it gets. It is true that dynamic typing sets limits in terms of project size.
- giraffe_lady 4y agoHave you ever built anything complex in it though? One of the pains of professional lua development is how much lay users admire its design. And it is true that its design is elegant and emerges from interesting and admirable constraints. In practice though it doesn't give you any of the tools you need to do anything except make tools to do those things. Which appeals to yak-shavers like us for sure. But if you need to sit down with it for months at a time and just get work out the door it fucking sucks. Also 5.1's GC is goddamn tragic. In practice you're usually at the mercy of whatever was implemented by the embedding runtime, but if you're ever left alone with just the raw 5.1 GC you'll wish you weren't. Later versions improved that dramatically.
- snek_case 4y agoCan you elaborate on why the 5.1 GC is so bad?
- giraffe_lady 4y agoHonestly I'm not an expert on that part of the lua internals so I can't confidently say why. I don't think it's a fundamental problem since later versions use the same approach afaik, so I assume it's just implementation nuance. 5.0 used, IIRC, mark-and-sweep which is not great either but it's predictable: it's easy to develop intuition for how much you're allocating and what the collection cost will feel like. The main practical issues I've run into with 5.1: - per-object overhead in time and space both increased significantly, making many small allocations much more expensive than fewer big ones. further pushing you into the "mutate a few huge global tables" pattern that is already a problem in lua conventions. - some of lua's more lauded and genuinely powerful features, esp metatables, don't work smoothly or predictably with the GC. it leads to people trying to manually tune it with __gc metamethods, which is hard to do correctly and causes memory leaks if done incorrectly. - weak tables idk,. esp with strings for some reason. similar to the __gc, there is a solution there but in practice it's very hard to be sure you've got it right and it's worse to get it wrong than to not try. I'm sure a PL expert can explain and justify all this but I am just a normal person who codes for money. Lua is admired for being simple and accessible, but especially in the older versions you get into the low level weeds real fast over this stuff. Kind of a good example of minimal implementation exposing you directly to irrelevant complexity, really.
- badsectoracula 4y ago> It feels like it's becoming a simpler language, as in many cases, it takes much less effort to tell the compiler what I want to say. I do not think this shows that Java is a simpler language, if anything it shows that it has more features (ie. being more complex as a language) that make it easier to match what you want to do. Java might be simpler (easier) to use, but that doesn't make it simpler as a language itself. For a more extreme example take C vs C++ - C is certainly simpler as a language than C++ and nobody would ever claim that C++ has any relation to simplicity as a language whatsoever, but a lot of things are much simpler to do in C++ than they are in C because of all the additional features C++ provides.
- weatherlite 4y agoSo its semantics over the meaning of simple - some mean simple as in not meany features, the other means simple to get things done with. Many people call C a hard language because it's quite hard to get stuff done with it, while others call it simple because the feature set is small and writing compilers for it is relatively easy.
- flohofwoe 4y agoIMHO the reason why it's "hard" to get stuff done in C (which I don't necessarily agree with), is mainly the bare bones stdlib, less the language. Eg C programming is much more library-driven than language driven. It sucks if the used libraries suck (such as most of the C stdlib), but it is great when using libraries with a modern API design (eg the opposite of POSIX).
- weatherlite 4y agoFrom the perspective of most high level programming - say web development, C has no advantages whatsoever.
- astrange 4y agoHmm, every piece of web infrastructure I just thought of (every browser, nginx, FreeBSD, your HL language runtime, nghttp2, curl, SSL) is written in C. Sure, you may not be touching those during your web development, but that’s because you don’t know how to have fun and outsourced it all.
- jhgb 4y ago> I never got the sense that it could scale much beyond one-person projects. Adobe Lightroom?
- Twisol 4y agoI'll wear that; I'd heard of Lightroom in the context of Lua, but I've never used it and don't know what it's for. Looks like its plugin architecture is a major selling point? Seems like a great fit for Lua.
- jhgb 4y agoThe UI widget toolkit and the low-level image processing code are in C++ but the people involved have said that the remaining half of the application is written in Lua. Nothing to do with plugins, really.
- Twisol 4y agoCool! I'd be curious how large the codebase is, but it's cool to hear that something like Lightroom exists at all.
- thfuran 4y agoGiven that it's made by the people who created a printable document format that supports embedded videos, I'm going to assume that it's an alarming large codebase.
- bmacho 4y agoThe name PDF stands for portable document format (the name itself isn't that relevant, but also the intention).
- anonymoushn 4y ago> Nonetheless, it's not a great fit for most domains; for instance, I never got the sense that it could scale much beyond one-person projects. I don't think it's really missing features compared to Python or Javascript that would help with this. Tooling could improve a lot though :)
- deleted 4y ago[deleted]
- tromp 4y ago> though the lambda calculus, SKI combinator calculus, or and MOV-only assembly are minimal in very real ways, the cognitive burden of expressing yourself in these languages is very, very high! But much less high with the lambda calculus than with the other two; Haskell is not far from being a layer of syntactic sugar on top of the lambda calculus. For an example of a non-trivial lambda calculus program, see this self-interpreter [1] for binary lambda calculus [2]. [1] https://github.com/tromp/AIT/blob/master/uni.lam https://github.com/tromp/AIT/blob/master/uni.lam [2] https://www.ioccc.org/2012/tromp/hint.html https://www.ioccc.org/2012/tromp/hint.html
- Twisol 4y agoTrue! I think pattern matching and the high-powered static type system really pull a lot of weight here, though. Haskell's types are a whole other dimension of domain modeling. You can encode algebraic data types as pure lambdas, but it's much less pleasant IMHO. (Laziness also bakes some common streaming patterns into the language core, which I find really nice, but it also makes it harder to totally understand what's going on sometimes, so it's a bit more of a toss-up.) Point being, nobody wants to model their data structures as pure lambdas; even primitive integers are an addition on top of the lambda calculus. > For an example of a non-trivial program I don't think I'm taking the point you wanted me to from this program. It's under 30 lines, yet I'd need to pore over this for twice as many minutes to comprehend what it's doing. I can see the lambda abstractions and applications clear as day, but what they're doing I couldn't say. (The comments clearly say it's a universal binary LC interpreter, but we don't usually judge languages by their comments.) EDIT: Right, okay, it's a submission to the the International Obfuscated C Code Contest. If it's obfuscated, then indeed, I'm not meant to comprehend it easily. Not sure that sells the lambda calculus.
- ackfoobar 4y ago> pure lambdas Also, in lambda calcalus there is no recursion built-in. You have to build it yourself with the Y combinator.
- 4y ago
- lifthrasiir 4y ago> I never got the sense that [Lua] could scale much beyond one-person projects. I had a misfortune to deal with more than 200K lines of Lua code back in time [1]. It seems that my experience doesn't necessarily match those of other big Lua users though; it does seem to work when everyone is willing to invest in self-contained environments. In the other words successful Lua users doesn't exactly use Lua, they use their own programming systems based on Lua. (I should note that such systems are not guaranteed to be successful, as evident from my case.) [1] https://news.ycombinator.com/item?id=18351788 https://news.ycombinator.com/item?id=18351788
- otikik 4y ago> I never got the sense that it could scale much beyond one-person projects It can be done, but it requires a lot of discipline. You might enjoy Teal, a sort of "Typescript for Lua" https://github.com/teal-language/tl https://github.com/teal-language/tl