9 ms·
Hi, author of the language here. Not a great time for HN exposure, as I just added a lot of new functionality, but none of that is documented yet :) But hey, a
by Aardappel 8y ago
Hi, author of the language here.
Not a great time for HN exposure, as I just added a lot of new functionality, but none of that is documented yet :) But hey, all publicity is good publicity?
For those interested, some recent things that have been happening:
- Compile time reference counting. This does an analysis similar to the Rust borrow checker to infer lifetimes, but unlike Rust doesn't make the programmer jump through hoops.
- "Inline" structs: structs are allocated in their parent, and come at zero overhead compared to individual variables, which is particularly useful for Lobster's heavy use of 2d & 3d vector types.
- Multi-threading that uses separate memory spaces, meaning individual threads can run at max speed with no GIL overhead etc.
- A WebAssembly backend is being worked on.
- A lot of optimization work to make the language run faster.
For reference, it has been on HN before, as early as 2013 (https://news.ycombinator.com/item?id=5904430 https://news.ycombinator.com/item?id=5904430), but it has changed a TON since then (e.g. it was a dynamically typed language, now it is statically typed, with flow sensitive type inference).
- calebwin 8y agoWould you mind elaborating on the "compile time reference counting"? Is this new? How does it handle cycles?
- steveklabnik 8y agoA comparison to Swift's ARC would also be of interest :)
- Aardappel 8y agoYup, I will write up the algorithm some time soon. I've seen Swift's intentions to add lifetime analysis to ARC, but from what I could see it is much more complicated in Swift, requires annotations, and with significant runtime overhead remaining.
- steveklabnik 8y agoArc isn’t that stuff, Arc is what it already does today. “Automatic reference counting.”
- Aardappel 8y agoI'm aware of that, I said "add lifetime analysis to ARC", as in, ARC is what I call regular runtime reference counting, and with lifetime analysis some of it can move to compile time.
- steveklabnik 8y agoYep oops, sorry. Anyway, psyched to see more people experimenting with this kind of thing!
- Aardappel 8y agoYes, I frankly feel this design space is the future of memory management. GC, begone!
- alexisread 8y agohttp://concurrency.ch/Content/publications/Blaeser_Component_Operating_System_PLOS_2007.pdf http://concurrency.ch/Content/publications/Blaeser_Component... This seems to scale out very well - it's kind of static GC analysis with RAII and erlang-style messaging.
- Aardappel 8y agohttp://aardappel.github.io/lobster/memory_management.html http://aardappel.github.io/lobster/memory_management.html
- Aardappel 8y agoIt is so new I haven't even documented it yet.. hence why I said the timing for this HN post isn't great. So imagine the current implementation does a lifetime analysis somewhat similar to Rust, but then where Rust would error out, this implementation simply inserts a runtime refc increase. This gets rid of most runtime refc overhead without the programmer needing to be clever about it. Then, I intend to add an optional type annotation that gets you the Rust behavior, for those cases where you want maximum control. I don't think its the right default though. The algorithm is more lenient than Rust, since I don't have any shared memory concurrency for example. I intend to write up more thorough details about the algorithm, but again, haven't gotten to it. It does not handle cycles. If you create cycles that you do not manually break, you'll get a cycle report at program exit that prints the kind of values that weren't reclaimed. You're then expected to fix your code accordingly :)
- obastani 8y agoAny chance you could you share some references on this kind of type inference? It sounds very interesting!
- Aardappel 8y agoIt is not an implementation of an existing paper or anything.. I am going to write it up soon, promise! Feel free to email or msg me if you want to be notified.
- alexisread 8y agoYou could try: http://liu.diva-portal.org/smash/get/diva2:20899/FULLTEXT01.pdf http://liu.diva-portal.org/smash/get/diva2:20899/FULLTEXT01....
- dbaupp 8y agoThat sounds more similar to Swift's approach, where the compiler does aggressive optimisation to elide reference counts were possible. Do you agree?
- 8y ago
- Aardappel 8y agoMore on the compile time reference counting here: http://aardappel.github.io/lobster/memory_management.html http://aardappel.github.io/lobster/memory_management.html
- Empact 8y agoDo you plan to accommodate multi-line lambda? Python is hamstrung on this front thanks to the white-space oriented formatting.
- dragonwriter 8y ago> Python is hamstrung on this front thanks to the white-space oriented formatting. You could have multiline lambdas with Python's signficant whitespace, the then-BDFL just didn't think it was important enough to accept any of the syntax options proposed for it or to bother finding another option, believing named functions were sufficient for the multiline case.
- nikofeyn 8y agof# has white-space oriented formatting.
- iaabtpbtpnn 8y agoOCaml doesn't care about white space, and I don't think SML does either, although F# does. Maybe you are thinking of Haskell?
- nikofeyn 8y agoi am sorry. you are right. i misremembered about sml (haven't written in it much and in a while) and incorrectly lumped in ocaml. i should have been more careful. f# was what was really on my mind.
- Aardappel 8y agoIt already does multi-line lambdas (lambdas and built-in control structures share the same syntax), see e.g. the call to "fold" here: https://htmlpreview.github.io/?https://raw.githubusercontent.com/aardappel/lobster/master/lobster/docs/C_style%20language%20Cheat%20Sheet%20for%20Lobster.html https://htmlpreview.github.io/?https://raw.githubusercontent...
- gpm 8y agoBtw, you have a bunch of dead links to Google+ (readme, the linked page, etc).
- Aardappel 8y agoOn http://strlen.com/lobster/ http://strlen.com/lobster/ I only see a dead link to Google+ (which I'll remove, thanks!), but no other dead links?
- senozhatsky 8y agoA very cool domain name, by the way.
- gpm 8y agoSorry, I meant you link to google+ a bunch, not you link to many different dead things. That I've noticed: Twice on that page, once in the readme, again in dev/readme and lobster/readme.
- kragen 8y agoHi! I might be an embarrassingly gushing fanboy about everything you do, so I'm probably biased here. (I wrote the FlatBuffers Wikipedia page, for example.) Lobster is pretty inspiring (despite not being nearly as radical as, e.g., Aardappel) with its lightweight lambdas and (like most of your work) a very minimal core language. Is there a comparison of different versions of Lobster somewhere? I'd like to be able to make statements like "My new language XYZ, unlike Lobster, is dynamically typed, resulting in difficulties such as plicplocpluc in developing the IDE" but different versions of Lobster now cover such a large part of the language design space that this is becoming difficult. For example, that statement doesn't make sense with respect to old versions of Lobster, which were also dynamically typed.
- Aardappel 8y agoHah! Thanks a lot for the wikipedia article :) Yes, Lobster is meant to be a much more pragmatic language, for people like myself to actually get the job of making a game done :) Other languages of mine are much more research-y. Though I will say I think the type system and lifetime analysis are pretty novel actually. I'd like to think there's really only one Lobster, while older versions are still recoverable, they for practical purposes don't exist anymore :) Have you seen https://htmlpreview.github.io/?https://raw.githubusercontent.com/aardappel/lobster/master/lobster/docs/philosophy.html https://htmlpreview.github.io/?https://raw.githubusercontent... ? That actually contains some history.
- nathanielc 8y agoLooks really interesting. Have you done any write ups on the type inference bits? Flow sensitive type inference looks like exactly what I need.
- kragen 8y agoThe standard work on flow-sensitive higher-order type inference proceeds from Olin Shivers's dissertation, but Oortmerssen has written a bit about his ideas on lambda-the-ultimate.
- Aardappel 8y agoThere's an informal description here: https://htmlpreview.github.io/?https://raw.githubusercontent.com/aardappel/lobster/master/lobster/docs/type_checker.html https://htmlpreview.github.io/?https://raw.githubusercontent... But yes, I should really write up a more technical description some day.
- SomeCallMeTim 8y agoSigh...Python indentation? I thought we'd moved beyond that as an industry...
- ironmagma 8y agoWhy would you think that? As an industry we’ve been moving more toward automatic formatting, enforced formatting via lint, and a move toward more standardization with white space. What would be the reason to not have it required by the language itself?
- vidarh 8y agoBecause it is a sufficiently divisive decision that it limits the audience. The threshold before I'd consider working with a language with significant indentation for example, is huge. And for my part at least, I've yet to see an automatic formatting tool that formats how I find things most readable.
- coldtea 8y ago>Because it is a sufficiently divisive decision that it limits the audience. Considering Python is the 2nd or 3rd top popular language in indexes like TIOBE and job entries, and within the top-5 for over a decade, that's empirically false. It might put off some insignificant minority (that's superficial like that), but not enough people not to be hugely successful.
- fouc 8y agocan you drop the need for the : at the end of the line if there's a newline? i.e. it seems like unnecessary syntax
- trizic 8y agoDo you have any plans to support building statically linked binaries like Go?
- Aardappel 8y agoCurrently the only way to do that is via output to C++. This will give you static binaries, but it is of course a more complex build than Go's direct executable output. Not sure if I'll ever do native codegen myself (as in, direct x86 or ARM), currently working on WebAssembly support, and LLVM IR is also a possibility.
- anonymoushn 8y agoAre the coroutines copyable? This is useful if you want to use time-travel netcode (like ggpo) and coroutines attached to game objects in the same game.
- Aardappel 8y agoI'm afraid they currently aren't, but there's no reason this couldn't be implemented. There's a "copy" function for reference types that currently errors on co-routines.
- anonymoushn 8y agoThat sounds great :) I found it a bit strange that the coroutines run until the first yield at the time they are created, but otherwise I quite like the system.
- S4M 8y agoIt looks nice! Do you have a gallery of games made with Lobster available somewhere?
- nubb 8y agoIs there a list somewhere of games written in Lobster?
- Aardappel 8y agoNo, most of them are unreleased. Here's one though: https://store.steampowered.com/app/687560/Avoid_The_Monsters/ https://store.steampowered.com/app/687560/Avoid_The_Monsters...
- sytelus 8y agoI have never understood why people create entire programming language when just creating a nice C++ library would been more than sufficient, desirable, integratable and adaptable. You can always export bindings for any target language and users would be saved from learning yet another beast that would be unmaintained in few years. I'm not saying never developing new language... If you have radically new thought, go ahead do it but just keep combining feature1 from this language and feature2 from that language doesn't make a lot of sense (especially the part of taking completely unrelated unsearchable word to name your language).
- vidarh 8y agoBecause the language affects how you think about things, and how productive you are. It matters. And in this case, this is someone with a 20+ year background of experimenting with new languages, ranging from production-ready (e.g. I used AmigaE a lot back in the 90's) to crazily experimental ones.
- dkersten 8y agoC++ is a complex beast and while I quite like working in it, I'm finding that the latest versions (17 and 20) are filled with features that I'm having trouble understanding. The surface for errors is also huge. I've been programming in C++ since about 2002 and I feel quite proficient in it, but, if given the option, I'll use something that is both safer/less error prone and more productive (and I say that as someone whose argued right here that C++11 and beyond is a very productive language). Beyond that and what sibling comment said, the author is known for creating various languages, so he clearly enjoys doing it and is making this language for himself. I have never understood why there's always somebody complaining that new languages are unnecessary when a new language is shown on HN. I personally love seeing new languages. I also recently went on a language hunt for something that met a specific need for a side project I'm working on and I came away empty handed because I couldn't find something that met my criteria[1], so I'm always on the lookout for something that might. [1] In case somebody has any suggestions for me, I want something with Clojure-like immutable data structures as a default (or something similar, at least), is native compiled to reasonably efficient and low footprint binaries (but is not as complex as Rust or Haskell), is a functional language (but with prettier syntax than OCaml, which was almost my choice, but when I started reading example code, its a complex mess of symbols <insert perl joke>). And... it needs reasonable library support... (at a minimum I need to be able to respond to HTTP requests, make HTTP requests, parse and generate JSON and talk to postgres, ideally using SQL and not an ORM). Haskell is probably my best bet, but I don't have the energy to learn all of its complex features.
- grok2 8y agoWeird, just yesterday, there was a link from a different language that seemed very similar to yours or at least has similar goals: http://cone.jondgoodwin.com/ http://cone.jondgoodwin.com/
- Aardappel 8y agoNot sure if I'd call these similar, Cone looks more low level, with more explicit typing etc. Looks cool though.
- abcd_f 8y ago> all publicity is good publicity ... unless it's an obituary :) (an old joke)
- akavel 8y agoOn first look, the language seems superficially similar to Nim. Which, per se, is certainly a plus in my book! ...but makes it somewhat difficult to understand when should I pick one or the other. Could you point out some important differentiators? (Apart from the current set of available libraries, which certainly make it appear more useful for the intended target audience at this very moment AFAIU, but in longer perspective are potentially somewhat secondary.)
- Aardappel 8y agoIt does have some similarities, mostly in the sense that both are using a Python-esque syntax, but that doesn't mean they have similar semantics. Some difference off the top of my head: - Nim so far has been a GC-ed language (I know manual allocation is possible, and an ownership system is planned, but this was the default for most code so far). Lobster has been reference counted (and now compile time reference counted) from the start. Nims proposed ownership system is pretty cool, but still requires a fair bit of programmer cooperation, in that sense it will sit somewhere between Rust and Lobster in terms of programmer friendlyness. - Lobster has a type inference algorithm that is able to go further than most languages in terms of allowing code without types to "just work". Nim has nothing even remotely like this. - Nim is faster. Nim was designed for near native speeds from the start, Lobster started life a very high level language that slowly become more low level. There's nothing that prevents Lobster being as fast as Nim, it just will take a bit more time. - Nim is more mature, in the sense that it has been around longer, has more libraries and tooling etc, and a larger community. - Lobster has great support for programming with higher order functions: terse syntax, best possible type inference, zero overhead (compared to manual loops), non-local returns etc. So in summary I'd choose Lobster over Nim if you care about Lobsters type and memory management or higher order function features, or if you like the idea of a language that makes games/graphics out of the box easier. If you just want to "get the job done", Nim probably is ahead of Lobster at the moment :)
- sullyj3 8y agoLightweight syntax and zero overhead for higher order functions sound fantastic. I'm very interested.
- k__ 8y agoPretty cool. How does it compare to Dyon? https://github.com/PistonDevelopers/dyon https://github.com/PistonDevelopers/dyon
- Aardappel 8y agoHadn't seen this, thanks! At first glance, it appears that the difference is that Dyon is dynamically typed and requires the programmer to get lifetimes right manually (though annotations, ordering, or clone), whereas Lobster is statically typed and does all lifetime analysis automatically (and falls back to a runtime reference count increase when analysis fails). You'll be able to force the Rust/Dyon behavior manually with a type annotation in the future.
- brianpgordon 8y agoThere's a lot of great technical info on the homepage, but it's tough for me to see the forest for the trees here. Could you make a short (probably oversimplified; that's ok) case for what Lobster is especially good at and why it's worth using rather than other programming languages? Or direct me to where one is already written?
- Bekwnn 8y agoAt a glance, one thing that makes it stand out is that it's minimal like a framework, but allows you to code in something with similarities to python, but with more design towards that task. Most python-esque languages are poorly suited for games in terms of performance/features. Seems to nail most of the desires of mobile/indie scale development.
- Aardappel 8y agoI was hoping the current homepage had that function, with a list of special features followed by some examples. You want it shorter? Something like "Get Python-like ease of use together with static typing and speed and built-in game programming functionality" ? That really doesn't do it justice. In the end, like most languages, it is a particular cocktail of trade-offs, and to see whether this suits you, you need see the full list of features. Maybe you want a list of features with an example for each? It's hard to make it short though, especially the type system.
- bluetwo 8y agoNot features. Benefits. Benefits show an increase in something good or a decrease in something bad. Better speed. Less code. Easier distribution. Lower cost.
- Aardappel 8y agoA lot of the benefits are hard to express in numbers, and I am not a marketing person. Does this particular kind of type system help you in your software engineering? Very hard to quantify, and depends on circumstances and even personal preference. I don't think I have any hard-number benefits that are meaningful.
- fossterer 8y agoHeyy @Aardappel Interesting project! I wanted to share your language with a game programmer I know but the links to documentation from your homepage look broken. Essentially https://htmlpreview.github.io/ https://htmlpreview.github.io/ is dysfunctional. Try accessing the sample links in that project's Github page.
- Aardappel 8y agoWeird, those links work fine for me. I guess I'll have to change them, though not sure what to.. annoying github doesn't have a way to view markdown pages. I guess for now, to read the docs online you could read the raw markdown here: https://github.com/aardappel/lobster/tree/master/lobster/docs/source https://github.com/aardappel/lobster/tree/master/lobster/doc... Better yet, just download the repo and read the html files in docs/
- Aardappel 8y agoNow all docs served from http://aardappel.github.io/lobster/lobster/docs/README_FIRST.html http://aardappel.github.io/lobster/lobster/docs/README_FIRST... which works much better
- cryptonector 8y ago- Multi-threading that uses separate memory spaces, meaning individual threads can run at max speed with no GIL overhead etc. Hmm? Does that mean that they are actual processes sharing no memory? EDIT: If so then that's a big downside. In Rust you get thread-safety for traditional, shared-memory threading/concurrency. Ideally you should be able to get as good as Rust for threading. Ultimately, I think it all depends on this: - Compile time reference counting. This does an analysis similar to the Rust borrow checker to infer lifetimes, but unlike Rust doesn't make the programmer jump through hoops. I mean, that would be a huge win, but there must be a trade-off. Can you elaborate?
- brianpgordon 8y agoEven if it does mean separate OS processes (which I doubt), keep in mind that on Linux basic POSIX threads are basically just processes with some shared memory mapped in. There's no real performance difference.
- Aardappel 8y agoThis does not mean separate processes, it simply spawns one "VM" per thread. Lobster VMs are pretty light weight (just a self contained object that has everything for a program to run). The advantage is that everything inside one VM can be single threaded, down to memory allocator. The threads then communicate by sending each other lobster values, similar to a "tuple space". I personally think this explicit communication style of concurrency is safer and easier to use than shared memory concurrency. As for the lifetime analysis, see some sibling comments: I need to do a good write-up of the algorithm. I wasn't anticipating this HN post :)
- cryptonector 8y agoAh, OK, sure. And I assume that Lobster compiles to bytecode then, that gets interpreted?