Hacker News new | ask | show | jobs
by c3534l 2639 days ago
I don't really see the point in using Python syntax and then throwing in a handful of random differences that don't have anything to do with the domain you're working in. Syntax level support for vector operations or for shader interopability I would get. Making for loops follow some randomly different syntax, I don't see the point of that.
4 comments

It is not intended to be Python compatible, it merely has indentation based syntax that is similar.

The cases where it differs from Python are actually for good reason: unlike Python that only has built-in control structures, here any function can look like if/for/while if it takes a lambda body.

This seems like a cool way to make an ad hoc dsl. I'm not a game programmer but I imagine it could be useful.
This seems like a cool way to make an ad hoc dsl. I'm not a game programmer but I imagine it could be useful

Smalltalker here. Being able to pass in lambdas very casually is a great way of producing an ad hoc DSL. Imagine a custom control structure which does a database transaction. Just implement a function!

Yup, this style of programming I use all the time in Lobster.
> unlike Python that only has built-in control structures, here any function can look like if/for/while if it takes a lambda body

That's absolutely fantastic. I've had to do a lot more Python programming for work, and I've been thoroughly disappointed by Python's lack of support for custom blocks/structures like that (contrast with Ruby or Elixir, where any function can take a do ... end, or with Tcl where "blocks" are just strings).

So is it a bit like Rebol (or Red, or even Joy if we pretend RPL is not a significant difference), or is it a very different style of implementation?
I welcome languages that take the idea of indentation as part of the language. I don't see that as belonging to Python, and I don't believe this language aims to be Python-compatible as opposed to inspired.
> I don't really see the point in using Python syntax and then throwing in a handful of random differences that don't have anything to do with the domain you're working in

I don't think it's using Python syntax, I think it and Python share some similarities. Thinking about it in Python terms is probably why the changes appear random/different/useless. But in general not being constrained by Python or another language has value.

Also 'include'? Why would you add the single most awful part of C/C++ to a python-alike.
It's not supposed to be a python-alike. It just happens to use indentation for blocks.
#include causes the preprocessor to replace it with the specified file. Why is that bad?
Because ostensibly we've moved on from that to the concept of actual modules.

'including' stuff entails a whole host of ugly things including multiple definitions, circular dependencies etc. etc..

Most languages use some kind of module resolution, which when specified clearly is usually better. Of course sometimes they forget to define things, and leave us in a lurch ... but hey ...

You're reading too much into the keyword.. in Lobster, this does never include anything twice. Circular dependencies just work, without having to pre-declare anything. I should probably rename it.
I suggest people might pick up on that pretty quick, maybe no need to rename given some random comment. That said, maybe you want to have a gander through the various languages and see what words are used for what, and if there's a 'standard' go with that :)

Cool language though. I love everything except for the name, sorry :)

Well, every time Lobster surfaces somewhere, I am always surprised how quickly people can superficially reject it because of some syntax issue, so yes, I agree, using predictable keywords where it makes no real difference matters. I've already made quite a few such changes.

The name.. I think people will quickly forget about the original meaning. Think of all the languages you know, and how you associate the name with the language, not some snake, a musical note, degraded iron, a french philosopher, etc. Some of these names are actually pretty silly.