Live data from Hacker News

The Lobster Programming Language

strlen.com

61–70 of 72 posts

Re: The Lobster Programming Language

#61
post #29

Earlier quoted context omitted.

I was mistaken ... not the author: https://quake.fandom.com/wiki/Wouter_Van_Oortmerssen_(Aardap...

Yes the author :) I make both programming languages and games / engines / maps..

I had misunderstood a comment elsewhere and had claimed that you were the author of Quake (which I now know was developed by a team). My link above acknowledges that you are the author of some Quake maps (among many other things).

Re: The Lobster Programming Language

#62

This is a really nice looking language. Feedback in case the creator sees but it wasn't obvious to me at first that it was targeting game development. The first mention is in features: > Features have been picked for their suitability in a game programming language Would be fun to see some basic games like tetris, pong etc in Lobster in case anyone has an example floating round?

Seen by creator :) It comes with a tiny minecraft clone in Agreed it could use more actual game examples. I've written a ton of game prototypes in it, and some could do with open sourcing, just haven't gotten around to it.

Hi, very nice language!

I noticed that Lobster, like many other languages, does not use the C style for-loop syntax, `for (int i = 0; i < m; i++): print(i);`. Could you say why that is? I have been writing Python for many years but still miss that C syntax. Initiating `i` right before every loop feels clunky to me.

Re: The Lobster Programming Language

#63

Earlier quoted context omitted.

Seen by creator :) It comes with a tiny minecraft clone in Agreed it could use more actual game examples. I've written a ton of game prototypes in it, and some could do with open sourcing, just haven't gotten around to it.

Hi, very nice language! I noticed that Lobster, like many other languages, does not use the C style for-loop syntax, `for (int i = 0; i < m; i++): print(i);`. Could you say why that is? I have been writing Python for many years but still miss that C syntax. Initiating `i` right before every loop feels clunky to me.

In Lobster, this is `for(m) i: print(i)` Or simply `for(m): print(_)`

The syntax comes from the observation that even in C-like languages, 99% of the time I want to iterate over the range (0..m-1), so that's what it is optimized for.

I don't enjoy writing the same boilerplate over and over. Moreover, because it is so verbose, it is hard to spot `for (int i = 0; i I am not sure what you mean by "Initiating `i` right before every loop"

Re: The Lobster Programming Language

#64
post #47

Looks like a cool language. Like the short syntax. Impressed they implemented so much of OpenGL natively in the language. Lot of work to implement OpenGL. With such a focus, be nice to have a few more OpenGL examples. Took a bit of looking, yet found a longer example for a 2D shooter. https://aardappel.github.io/lobster/shooter_tutorial.html However, the real test, from personal perspective, especially with a custom…

the "gl" namespace is really a bit of misnomer since it is much higher level API than OpenGL, and does not really depend on OpenGL. It could pretty easily run on another API underneath. The repo comes with a LOT of graphical samples (in the "samples" dir). The lights are more of standard way of passing them to the shader (see the phong shader implementation). Matrices are a bit of a weak spot since its all implicit (…

Cool. Thanks for the reply and clarification. Although the clarification is admittedly confusing when it's called the "gl" namespace.

Not seeing a phong example in the samples dir. "pendulum.lobster", "physics_boxes.lobster" Only reference to "phong" brought back in a search was milen-prg's comment on Aug 7, 2023 about using the phong shader in the "cgtest.lobster" example.

Re: The Lobster Programming Language

#65

Earlier quoted context omitted.

Seen by creator :) It comes with a tiny minecraft clone in Agreed it could use more actual game examples. I've written a ton of game prototypes in it, and some could do with open sourcing, just haven't gotten around to it.

Ah hey, nice language! A minecraft clone in <100 lines sounds like a pretty awesome feat, I'll definitely check it out!

https://github.com/aardappel/lobster/blob/master/samples/lob...

It brings the joy back to graphics and game programming.

Re: The Lobster Programming Language

#66
post #47

Looks like a cool language. Like the short syntax. Impressed they implemented so much of OpenGL natively in the language. Lot of work to implement OpenGL. With such a focus, be nice to have a few more OpenGL examples. Took a bit of looking, yet found a longer example for a 2D shooter. https://aardappel.github.io/lobster/shooter_tutorial.html However, the real test, from personal perspective, especially with a custom…

the "gl" namespace is really a bit of misnomer since it is much higher level API than OpenGL, and does not really depend on OpenGL. It could pretty easily run on another API underneath. The repo comes with a LOT of graphical samples (in the "samples" dir). The lights are more of standard way of passing them to the shader (see the phong shader implementation). Matrices are a bit of a weak spot since its all implicit (…

Do you intend on adding a phys namespace, for stuff like jolt or bullet?

Re: The Lobster Programming Language

#67
post #2

Nice! So it looks like polymorphism is done via C++ template-style ad-hoc polymorphism? Are there any restrictions on it? Also, is there any kind of sophisticated pattern matching? I feel like for me a language without pattern matching is a non-starter these days.

Yes, its somewhat similar, monomorphic specialization. I am sure it has some limitations, but it is pretty powerful, it can even do things C++ can't, like have a type error in a branch that in the current specialization is never executed doesn't count as a type error :) There's no FPL style pattern matching. It can do a switch case on types (the various subclasses of a base class) but only 1 level, i.e. can't match a…

> like have a type error in a branch that in the current specialization is never executed doesn't count as a type error

I’ve struggled with my feelings on this even to the extent that C++ allows it, because while it is flexible, it can also hide errors in libraries that will only blow up when used in very specific ways.

Re: The Lobster Programming Language

#68
post #64

Earlier quoted context omitted.

the "gl" namespace is really a bit of misnomer since it is much higher level API than OpenGL, and does not really depend on OpenGL. It could pretty easily run on another API underneath. The repo comes with a LOT of graphical samples (in the "samples" dir). The lights are more of standard way of passing them to the shader (see the phong shader implementation). Matrices are a bit of a weak spot since its all implicit (…

Cool. Thanks for the reply and clarification. Although the clarification is admittedly confusing when it's called the "gl" namespace. Not seeing a phong example in the samples dir. "pendulum.lobster", "physics_boxes.lobster" Only reference to "phong" brought back in a search was milen-prg's comment on Aug 7, 2023 about using the phong shader in the "cgtest.lobster" example.

if you find in files for "phong" you should be able to find samples that use it.. the actual shader is in data/shaders/default.materials

Re: The Lobster Programming Language

#69

Earlier quoted context omitted.

the "gl" namespace is really a bit of misnomer since it is much higher level API than OpenGL, and does not really depend on OpenGL. It could pretty easily run on another API underneath. The repo comes with a LOT of graphical samples (in the "samples" dir). The lights are more of standard way of passing them to the shader (see the phong shader implementation). Matrices are a bit of a weak spot since its all implicit (…

Do you intend on adding a phys namespace, for stuff like jolt or bullet?

Would love to add Jolt at some point, yes.

There's already bindings for Box2D in the "ph" namespace.

Re: The Lobster Programming Language

#70
post #67

Earlier quoted context omitted.

Yes, its somewhat similar, monomorphic specialization. I am sure it has some limitations, but it is pretty powerful, it can even do things C++ can't, like have a type error in a branch that in the current specialization is never executed doesn't count as a type error :) There's no FPL style pattern matching. It can do a switch case on types (the various subclasses of a base class) but only 1 level, i.e. can't match a…

> like have a type error in a branch that in the current specialization is never executed doesn't count as a type error I’ve struggled with my feelings on this even to the extent that C++ allows it, because while it is flexible, it can also hide errors in libraries that will only blow up when used in very specific ways.

Yes, that is a downside, but when you write very generic code being limited in what code you can write because it has to typecheck even for types that it doesn't apply to is one of the more frustrating things of doing this in C++ and other languages.
Post reply on HN