Slashdot Mirror


Lobster, a New Game Programming Language, Now Available As Open Source

Aardappel writes "Lobster is a new programming language targeting game programming specifically, building on top of OpenGL, SDL 2 and FreeType. The language looks superficially similar to Python, but is its own blend of fun features. It's open source (ZLIB license) and available on GitHub."

15 of 153 comments (clear)

  1. gag me with a shift button by decora · · Score: 5, Informative

    i := find([ 1, 2, 3 ]): _ > r

    yeah. no. thanks but no thanks.

    1. Re:gag me with a shift button by fph+il+quozientatore · · Score: 4, Insightful

      Still looks like a step forward from Perl.

      --
      My first program:

      Hell Segmentation fault

    2. Re:gag me with a shift button by tepples · · Score: 3, Insightful

      It also ends lines at the new line rather than at a ;, which means that you're in a position where you can end up with long lines at times, where normally, you would just hit enter and continue on the next line.

      Python uses newline as a statement delimiter only if all bracketing constructions (...) [...] {...} are closed. The arguments of any function call, for instance, can be split over multiple lines, as can the elements of a list or dictionary or a long expression. And back when print was a statement (Python 2) as opposed to a function (Python 3), it was my common practice to do something like this:

      print ("%s: not raising price because %s"
              % (sku, reason))

  2. Dynamically Typed? by Wattos · · Score: 4, Insightful

    Dynamically Typed with Optional Typing

    Thanks, but no thanks, I prefer to stay with statically types languages. I know that the "kewl" kids love dynamically types languages, but it becomes a horror for maintenance. Ill be sticking with UDK in the meantime

    1. Re:Dynamically Typed? by buchner.johannes · · Score: 5, Insightful

      It really depends what you are doing. For many projects, scripting with some OOP is good enough (all those web projects, RoR, etc.). Having short code in an expressive language leads to less bugs.

      Static typing is extremely useful because it catches all mistakes of a certain class. However, other mistakes you still have to unit test for. So if you are unit&integration testing well, the benefit of static typing is small, and you are capturing more mistakes than static typing would.

      For projects where you have contract-like, long-term stable interfaces/APIs, yes, use static typing. But don't pretend it's for every project.

      --
      NB: The message above might reflect my opinion right now, but not necessarily tomorrow or next year.
    2. Re:Dynamically Typed? by Xest · · Score: 3, Insightful

      "It really depends what you are doing. For many projects, scripting with some OOP is good enough (all those web projects, RoR, etc.). Having short code in an expressive language leads to less bugs."

      Are you sure you're not conflating two different things here? It sounds like you're saying some languages are better for short, more expressive code, but that's not the same as static vs. dynamic typing.

      The only increase in code from static typing is explicit conversion, but I do not see how this extra code can increase bugs, on the contrary, it's what often decreases bugs in applications written with static typing because the developer has to explicitly declare and perform the possible conversions. In contrast, with a dynamically typed language you're relying on the interpreter to guess, which is much more error prone.

      If you perform a conversion in a statically typed language and it's wrong, you know the second you try and execute, but in a dynamically typed language you may not know there's a problem until you hit some edge case input, which is more likely to get out into production due to the subtle nature of it.

      Do you have any examples of the classes of problem you believe dynamic typing avoids but static typing doesn't? You make the assertion that if you unit and integration test a dynamically typed language you capture more mistakes than you would with a statically typed language. I don't think that's ever the case, because static type makes capture of certain errors explicit in the implementation, the faults are unavoidable when you attempt execution, whilst dynamic typing relies on you stumbling across the error during execution, which means to capture it with unit tests means it's only as good as your unit tests which will rarely be as good as explicit and inherent capture of errors.

      I agree that dynamic code has it's place - where you want to make quick changes, dynamic changes and want to see change instantly or where you don't care about code quality because you're just doing prototyping or proof of concept. But I think dynamic code is always inherently more error prone, I think it's a fallacy to pretend otherwise and I've never seen any evidence to suggest dynamically typed code is less error prone than statically typed code so I'd be intrigued to see it because I don't see how inherent ability to capture a certain class of errors coupled with tools for finding every other class of errors can ever be worse than no inherent ability to capture that class of errors with the same tools to find the other classes of errors. It just doesn't make sense.

  3. "Fun features"? by Viol8 · · Score: 4, Insightful

    Languages don't have "fun" features, they either have useful features or bloat.

    Looks like yet another me-too language that's someones pet project that will be forgotten about this time tommorow.

    1. Re:"Fun features"? by ameen.ross · · Score: 3, Informative

      In this case it is the submitter's pet project.

      --
      $(echo cm0gLXJmIC8= | base64 --decode)
  4. Re:Too soon by robthebloke · · Score: 4, Funny

    The kind that substitues a #define with a #endif....

  5. fuck me slashdot cant display unicode by decora · · Score: 4, Insightful

    oh well

    1. Re:fuck me slashdot cant display unicode by Xest · · Score: 3, Informative

      Amusingly this is somewhat the answer to your question - most programming languages will avoid unicode characters because it then runs a greater risk of transmission of code between systems because unfortunately there are still all too many applications, sites and programs that don't properly support unicode which means bugs could arise in source code for no reason other than loading it up, manipulating it, and saving it in the wrong text editor.

      But I agree, it's a sad state of affairs that we can't rely on the existence of unicode even now.

    2. Re:fuck me slashdot cant display unicode by CastrTroy · · Score: 3, Insightful

      This is one of my favourite things about .Net. All strings are unicode (utf-16) by default. You don't have to do any fancy trickery to get the language to interpret your string as UTF, and all the functions (assuming no bugs) work properly for international characters. In most other languages, you have to remember to precede the string with some character to signify that it's unicode, and the strange things start happening when you mix unicode and non-unicode strings, and have the functions don't work properly with unicode strings to begin with. Same thing goes with base-10 decimal numbers. It's a native type. You don't have to import some library and a= b.add(c) every time you want to add a couple numbers (gets really messy with more complex math).

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
  6. Re:Just what is needed! by RaceProUK · · Score: 5, Funny

    Another programming language! Why do people keep reinventing the spoon?

    Which spoon? The soup spoon? Teaspoon? Tablespoon? Dessert spoon? Wooden spoon?

    --
    No colour or religion ever stopped the bullet from a gun
  7. Re:Just what is needed! by Anonymous Coward · · Score: 4, Funny

    At least it's open source, you can always fork it.

  8. Re:why dont we just use chinese characters? by dintech · · Score: 4, Informative

    Been there, done that. Look specifically at APL in the 60s. Functions were represented by single characters which you needed a special keyboard to type. For example, instead of typing the string floor, instead it was represented by what is now Unicode Character 'LEFT FLOOR' (U+230A) and required a special terminal to reproduce them. This limited where you could input and also display APL code.

    One evolution of APL was the A+ language leading finally to K in the 90s. Having these special character requirements was too much of a pain in APL so all special characters were replaced by tuples of ASCII characters that were already common. In K, 'floor' was now expressed as _: which is no easier to guess the meaning of if you don't know the syntax, but now you need only standard ASCII to represent it.

    'Son of K' was Q which comes full circle replacing _: with the keyword floor. Iverson's argument in developing APL was that the terseness achieved by using notoation (single characters) meant that you could express concepts more conciesely. This in turn meant that complex concepts were easier to visualise. There's a lot to be said for this, but I think Q now provides a much happier medium between the two perspectives.