The Dream Programming Language? Lobster

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 เม.ย. 2023
  • A concise walkthrough of Lobster, a programming language that has a Python-like syntax but is statically typed with next-level inference and does not rely on a garbage collector.
    -
    Camera: Canon EOS R5 amzn.to/3CCrxzl
    Monitor: Dell U4914DW 49in amzn.to/3MJV1jx
    SSD for Video Editing: VectoTech Rapid 8TB amzn.to/3hXz9TM
    Microphone 1: Rode NT1-A amzn.to/3vWM4gL
    Microphone 2: Seinheiser 416 amzn.to/3Fkti60
    Microphone Interface: Focusrite Clarett+ 2Pre amzn.to/3J5dy7S
    Tripod: JOBY GorillaPod 5K amzn.to/3JaPxMA
    Mouse: Razer DeathAdder amzn.to/3J9fYCf
    Keyboard (sometimes): Keychron Q1 amzn.to/3YkJNrB
    Computer: 2021 Macbook Pro amzn.to/3J7FXtW
    Lens: Canon RF24mm F1.8 Macro is STM Lens amzn.to/3UUs1bB
    Caffeine: High Brew Cold Brew Coffee amzn.to/3hXyx0q
    More Caffeine: Monster Energy Juice, Pipeline Punch amzn.to/3Czmfox
    Building A Second Brain book: amzn.to/3cIShWf
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 401

  • @toyin5522
    @toyin5522 ปีที่แล้ว +107

    "Languages faster than python are more common like hydrogen atoms" 😆 🤣

    • @NoidoDev
      @NoidoDev 9 หลายเดือนก่อน +2

      People are always just referring to runtime speed, not development speed or the learning curve.

    • @novamc7945
      @novamc7945 7 หลายเดือนก่อน +7

      @@NoidoDev But that is what speed *should* refer to. How your app performs in production is more important than the development, but that's my opinion

    • @mikumikudice
      @mikumikudice 3 หลายเดือนก่อน

      ​@@NoidoDev ok, you lanched your app in three days. now add a new feature without breaking everything. try to factor out a type. even in this parameters python is slow

    • @camwhit8892
      @camwhit8892 10 วันที่ผ่านมา

      @@novamc7945 I feel like both are really important.

  • @Nox3x3
    @Nox3x3 ปีที่แล้ว +195

    I love everything about this. That's why I use Nim. It has almost all of these features, except for the hardcore inference, but is much more mature. Yes, including the memory system.

    • @nERVEcenter117
      @nERVEcenter117 ปีที่แล้ว +59

      A LOT of these newer languages seems to be re-implementing features that are already extremely mature in Nim. I'm still shocked it has so little reach given that people keep making languages that do what it does incredibly well, and has done for a decade. But PLs are a hype-driven domain. New and weird always seem to beat older and stable.

    • @JustSomeAussie1
      @JustSomeAussie1 ปีที่แล้ว +37

      Nim compiler errors really suck, and the syntax is too loose (some_func and someFunc are the same thing).

    • @thephoenixsystem6765
      @thephoenixsystem6765 ปีที่แล้ว +20

      @@JustSomeAussie1 that is a turnoff

    • @asandax6
      @asandax6 ปีที่แล้ว +13

      ​@@JustSomeAussie1 Yeah that's the reason I dropped nim. Too many ways to the same thing = confusion when reading someone else's code.

    • @culi7068
      @culi7068 ปีที่แล้ว +5

      tbh the hardcore inference is the only thing that really caught my eye. The other features seem nice but kinda like double-edged swords (and not in a "this might lead to bad practices because it makes you lazy" way. Rather in a "the language has structural limitations on what it can do now because it bent over backwards to support this neat syntactic sugar" way).
      I wish TypeScript's inference got this good

  • @nitsanbh
    @nitsanbh 4 หลายเดือนก่อน +3

    This language is like my high school essays. I had zero unique ideas to say so I copied sentences from articles on the web and called it a new article

    • @codetothemoon
      @codetothemoon  4 หลายเดือนก่อน

      I think of programming languages like recipes - cheese, tomato sauce and bread all existed before pizza. But despite that, pizza is still novel (and amazing) isn't it?

    • @lepidoptera9337
      @lepidoptera9337 4 หลายเดือนก่อน

      @@codetothemoon Yeah, if you are treating languages like pizza, then you will find even programming the temperature controller of a pizza oven hard. ;-)

  • @doktoracula7017
    @doktoracula7017 ปีที่แล้ว +20

    A lot of stuff in Lobster reminds me of Koka, especially all the syntax sugar. It also has indentation based scopes but those are defined as implicit brackets (and code is desugared to those brackets).

  • @daviidon
    @daviidon ปีที่แล้ว +35

    Parameter type inference is standard in the ml family(eg:F#). The dev ex is a little better as the ide will show the inferred types so you get all the benefits of specifying the type without having to write it out.

  • @mr.m8539
    @mr.m8539 ปีที่แล้ว +32

    Wish you covered memory management more in depth.

  • @GreatWalker
    @GreatWalker ปีที่แล้ว +15

    @8:56, it kinda looks a little more concise than Python 2/3 because there is no constructor in the class definition or dataclass decorator (pls ignore the `let` keyword)

  • @JoelJosephReji
    @JoelJosephReji ปีที่แล้ว +7

    Thanks for the great video! I found a little audio issues like some "pops" in between and maybe this info would help you sort that issue out (I initially thought that it had something to do with my headphone but then I confirmed it by listening from the laptop speaker)! (keep the good work going btw!)

    • @mskaarupj
      @mskaarupj ปีที่แล้ว +1

      I also get these pops. They are also in the Leaps for neovim video

  • @irlshrek
    @irlshrek ปีที่แล้ว +54

    my initial thought is that I think that its possible to be so concise so as to be harder to reason about and in my opinion this, at least, treads that line. Its like, you COULD make a Venn Diagram without the circles but does it actually make it better?

    • @J-Kimble
      @J-Kimble ปีที่แล้ว +6

      Yeah I know what you mean. I think about golang along these lines.

    • @WoutervanOortmerssen
      @WoutervanOortmerssen ปีที่แล้ว +8

      It is so concise because Lobster thinks these things (like trailing lambdas) are more fundamental than other languages do, and wants to make them as easy to use as built-in control structures for example. There are ways to make lambdas / types more verbose if you want, but yes, if you dislike looking at concise code in general then Lobster is not for you :)

    • @wafikiri_
      @wafikiri_ ปีที่แล้ว +8

      ​@@WoutervanOortmerssen I do like concise code, up to but not including figuring out what I meant. Concise but formal and well-defined syntax is a must for me.

  • @headder7802
    @headder7802 ปีที่แล้ว +10

    Strange... It looks like Rust, Nim, Crystal and Python had a baby... ;P

  • @soanvig
    @soanvig ปีที่แล้ว +4

    The problem I can see here is variable mutation. Albeit you have let/var, if the let contains class you are able to modify the class instance itself assigned to that name.

  • @lekretka
    @lekretka 9 หลายเดือนก่อน +4

    The type inference looks very powerful. I tried F#, but this thing is on another level. Curious how it works under the hood, but it seems like Go duck typing or C++ templates, but you don't need to declare interface or specify parameter type. Never seen something like that in a statically typed language.

    • @codetothemoon
      @codetothemoon  9 หลายเดือนก่อน +1

      that was my impression as well! Seems like it gives us pretty much all the advantages of dynamic typing, but with none of the downsides

  • @NOPerative
    @NOPerative ปีที่แล้ว

    Concise, fun vid.
    Good stuff.

  • @EliteTester
    @EliteTester ปีที่แล้ว +7

    This is exactly the mix of simlicity and terseness that I would expect from a good game dev, it kinda looks like a python+lua with types :D

  • @somcho
    @somcho ปีที่แล้ว +3

    for the next one I'd like to hear your summary/thoughts on lean4 prover functional programming language

    • @astroid-ws4py
      @astroid-ws4py ปีที่แล้ว

      And Glamorous Toolkit in Pharo for interactive (live objects) development style will also be cool.

  • @freedom_aint_free
    @freedom_aint_free ปีที่แล้ว +4

    It kinda put itself in the toy language category the moment it stated in "What lobster is not" that it is not suitable for big projects.

    • @codetothemoon
      @codetothemoon  ปีที่แล้ว +2

      I agree it's a bit ominous of a statement to see when you're deciding whether to invest time in learning a new language

    • @thavrisco1632
      @thavrisco1632 ปีที่แล้ว +1

      The author claims Lobster is not for AAA games because it lacks features that smaller creators probably don't want and what big studios do want. It's like the difference between coding proprietary software for game development and using a game engine. Many AAA game companies don't use Unity or Unreal because they need something specific to their complex needs and these game engines get in the way of that.
      So Lobster is like Unity in that large studios might not want to use it for their projects.

    • @NoidoDev
      @NoidoDev 9 หลายเดือนก่อน +2

      Calling such languages "toy languages" is the problem. Some people need something powerful to work on their own projects, without a team.

  • @daviidon
    @daviidon 7 หลายเดือนก่อน +2

    I just wrote my first program in lobster and love the syntax. Only issue I have is that there's no method chaning ie: filter().map()

  • @lolwingding
    @lolwingding ปีที่แล้ว

    Please make a video on Cone lang, I found it through C3 lang. Love your thoroughness 😍

  • @angeldude101
    @angeldude101 ปีที่แล้ว +4

    Not for me. For one, most of this video was focused on syntax, which is the _one_ thing I would change about Rust (I'd rather it looked more like Haskell, but oh well), but mainly I like Rust because it gives explicit control and tight restrictions that let me use that control without worrying. The language will automatically allocates if it can't solve the ownership? That's a deal breaker for me. What if I don't _have_ an allocator to begin with?

  • @qsykip
    @qsykip ปีที่แล้ว +11

    The type inference for functions seems to work like Julia, which is even more powerful because of its multiple dispatch.

    • @WoutervanOortmerssen
      @WoutervanOortmerssen ปีที่แล้ว +12

      Except Julia will default to dynamic typing if it can't infer types, and Lobster will error :)

  • @pixl_xip
    @pixl_xip ปีที่แล้ว +2

    Flying cars in 1985? 😂 Great video!

  • @gabriellevesque2185
    @gabriellevesque2185 ปีที่แล้ว +50

    Hmm, "yet another language". :P

    • @codetothemoon
      @codetothemoon  ปีที่แล้ว +9

      indeed!

    • @iglobrothers645
      @iglobrothers645 ปีที่แล้ว +4

      Took what makes C and rust so great and threw it out the window...
      (talking about curly brackets)

    • @klamberext
      @klamberext ปีที่แล้ว

      And decided to base itself on Python 😢

  • @driden1987
    @driden1987 ปีที่แล้ว +8

    Hmmm, not really a fan of having so many syntactical subtleties. I am a fan of having one way to do things

  • @comproprasad6438
    @comproprasad6438 ปีที่แล้ว +6

    This looks like my dream programming language

  • @jaysonbunnell8097
    @jaysonbunnell8097 7 หลายเดือนก่อน

    most languages that I've seen with hindley-milner type inference make it necessary to declare types for function signatures (although fundamentally it isn't necessary). Cool vid!

    • @mattetis
      @mattetis 8 วันที่ผ่านมา

      What languages are those?
      I only know of Haskell and OCaml and they do not require that

  • @DataPastor
    @DataPastor ปีที่แล้ว +1

    Does it have a binding library for Python, such as PyO3 of Rust? It would be great to write Python libraries in Lobster.

    • @matrix07012
      @matrix07012 ปีที่แล้ว +5

      Have you tried Nim? It's fairly similar to Lobster, but more mature and does have Python bindings

    • @DataPastor
      @DataPastor ปีที่แล้ว +1

      @@matrix07012 I listened to you and checked Nim. I always knew that Nim users love it, but until your comment I have never checked it. I have to say WOW. This is amazing. Thanks for your proposal!

  • @BraxtonMeyer
    @BraxtonMeyer ปีที่แล้ว

    what font are you using. Reminds me a lot of Code New Roman...

  • @mrmagnetic927
    @mrmagnetic927 ปีที่แล้ว +10

    Haha, Another crustacean library ( i see what they did there ). Lets call it the Seafood stack😂

    • @codetothemoon
      @codetothemoon  ปีที่แล้ว +2

      LoL sounds good to me 🦀🦞🦐

  • @michaelsydenham2918
    @michaelsydenham2918 11 หลายเดือนก่อน +6

    Great video. The author has listed 'consider using something else instead of _ for namespaces' in his todo list. I guess it's possibly a concern if you use _ in your variables.

    • @codetothemoon
      @codetothemoon  11 หลายเดือนก่อน

      thank you! yeah I heard this issue was going to be addressed which seems like a great thing

  • @uzimonkey
    @uzimonkey ปีที่แล้ว +1

    The duck typing and anonymous function as last argument syntax is very Ruby-esque.

    • @codetothemoon
      @codetothemoon  ปีที่แล้ว

      Definitely - the really cool thing though is that you get static type checking at compile time, despite the syntax being concise like Ruby!

  • @bobweiram6321
    @bobweiram6321 4 หลายเดือนก่อน +1

    Whenever I see the **def** keyword in a language, I already know it favors brevity over clarity.

    • @codetothemoon
      @codetothemoon  4 หลายเดือนก่อน

      why is that?

    • @bobweiram6321
      @bobweiram6321 4 หลายเดือนก่อน

      @@codetothemoon Def is meaningless. Def what? Leopard? Oh, it's short for define? So functions are defined but not the rest of the program? Function is more descriptive. Why is it so hard to spell out keywords, especially when there's no screen real estate penalty, powerful text editors, and Language Servers. In my experience, brevity also carries with it laziness and sloppiness in the language designers as well as the person programming in it. Don't believe me? C/C++ code is ugly and sloppy when compared to Pascal or Ada.

  • @bertiesmith3021
    @bertiesmith3021 ปีที่แล้ว

    What is the point of the parameter type determining whether it is passed by value or reference, rather than the caller making that choice?

  • @josgraha
    @josgraha ปีที่แล้ว +1

    nice memory management features but type inference and no pattern matching :(. thank you so much for the tour, well done!

  • @oglothenerd
    @oglothenerd 4 หลายเดือนก่อน +1

    I am making my own language. It aims to merge Zig and Rust together, and aims to solve flaws like relying on an Internet connection just to compile.

  • @everestshadow
    @everestshadow ปีที่แล้ว +7

    For implicit ownership memory management it comes down to how often can the compiler remove reference counting. If it can not do it's job well you end up with one of the worst kind of GC.

    • @terryriley6410
      @terryriley6410 10 หลายเดือนก่อน +2

      why is RC the worst kind of GC?

  • @soyitiel
    @soyitiel ปีที่แล้ว +9

    12:27 maybe a better way to execute the *_x* notation, where x is a-z, would be to type *$n* , where n is 0-infinity, a bit more flexible
    everything else seems awesome

    • @IMJamby
      @IMJamby ปีที่แล้ว +3

      I guess if you need more than 26 parameters for a function you definitely have bigger problems 😅

    • @soyitiel
      @soyitiel ปีที่แล้ว

      @@IMJamby Yeah, I guess you're right. I still think my solution is bit more intuitive, and of course since I'm biased, but you're totally right

    • @terryriley6410
      @terryriley6410 10 หลายเดือนก่อน +1

      @@soyitiel $1 looks confusing and noisy. it's fine in bash but I much prefer _a * _b than $1 * $2. the former feels better to type as well as being easy on the eyes.

  • @antoniong4380
    @antoniong4380 4 หลายเดือนก่อน

    8:19 this wild Type Inference wouldn't really fit in rust because (talking for myself) there's no clear way on how to solve conflicting names (yeah, I guess just import as a different name), I feel like might incur heavier compile times.
    Weird or hard ABI(?) interface support
    Rust Compiler was designed to only see your function signature at callsite. It then checks if the defined Function Signature matches with the body. It is a bit easier to make sense imo because you would only be worried that you work with whatever was defined in the function signature, however I agree this gives an advantage towards fast prototyping

  • @jekyllorhyde9785
    @jekyllorhyde9785 9 หลายเดือนก่อน +7

    Something that I have grown to accept about coding as I've gone further along, is that, in the words of Tim Peters: "Explicit is better than implicit"

    • @codetothemoon
      @codetothemoon  9 หลายเดือนก่อน +1

      I actually mostly agree with the spirit of that statement, but I also think that, as with many of these types of blanket statements - there are always exceptions

  • @AD-zs9cc
    @AD-zs9cc ปีที่แล้ว +6

    Reminds me of scala, both with syntax and static type inference. Will be cool to see if the memory management works as intended.

  • @user-zd9wd
    @user-zd9wd ปีที่แล้ว

    How does it deal with reference cycles

  • @thomasrosebrough9062
    @thomasrosebrough9062 ปีที่แล้ว +2

    I don't understand how that is memory management if it isn't garbage collected? Do you have to manually call something that's like "clear any memory with no ownership"?

    • @codetothemoon
      @codetothemoon  ปีที่แล้ว

      nope - it uses automatic reference counting under the hood. So you get the same benefits as a garbage collected language in terms of not having to manually manage memory, but the runtime overhead is more predictable (and in some cases, non-existent). My understanding is that it doesn't handle cycles though.

  • @wojtek1180
    @wojtek1180 8 หลายเดือนก่อน +1

    I see something about "this new programming language" i click . What can I say I'm simple man

    • @codetothemoon
      @codetothemoon  8 หลายเดือนก่อน

      I'm the same way... 😎

  • @Pythagoras1plus
    @Pythagoras1plus ปีที่แล้ว +2

    whoa... this is the game developer who made the cube and sauerbraten fps games that have an included editor by just pressing E 😮

    • @codetothemoon
      @codetothemoon  ปีที่แล้ว +1

      looks like it! I actually hadn't heard of these.

  • @omashune5546
    @omashune5546 ปีที่แล้ว +1

    wow, looks really interesting!

  • @torarinvik4920
    @torarinvik4920 ปีที่แล้ว +1

    Wow, this is close to perfect.

  • @donleyp
    @donleyp ปีที่แล้ว +1

    The inference of duck-typing is pretty cool.

  • @guilherme5094
    @guilherme5094 ปีที่แล้ว +1

    At the beginning of the video:
    Lobster what?
    At the end of the video:
    It looks really interesting👍

  • @edgeeffect
    @edgeeffect ปีที่แล้ว +1

    "If you squint, you feel like you're writing Haskel".... ... or Ruby! :)

  • @MrAbrazildo
    @MrAbrazildo ปีที่แล้ว +3

    I guess the only thing world needs, for leading language, is an easier way to catch undefined behavour in C++.

  • @sumitftr
    @sumitftr ปีที่แล้ว +4

    this language should replace python, which will be a great improvement in execution time

    • @NoidoDev
      @NoidoDev 9 หลายเดือนก่อน

      We have Mojo, also Nim exists. But we'll see.

  • @Stopinvadingmyhardware
    @Stopinvadingmyhardware ปีที่แล้ว +4

    Another language, and still the same barrier of entry with development environments.

  • @marioschmidt1251
    @marioschmidt1251 ปีที่แล้ว +1

    Does it have multi-inheritance or traits or interfaces or something?

    • @WoutervanOortmerssen
      @WoutervanOortmerssen ปีที่แล้ว +1

      Nope, currently just single inheritance.. that has so far worked well for gamedev and its "functional" orientation. Its easy to do the equivalent of interfaces informally with static duck typing, i.e. "this will work on any type with a foo method" but there is no way to specify that formally currently.

    • @wafikiri_
      @wafikiri_ ปีที่แล้ว

      Multi-inheritance really means you are not classifying anymore, single inheritance gives way to a tree structure of mutually-excluding classes whereas multi-inheritance's structure is latticial and results in not necessarily mutually excluding kinds while still ontologically permitting generalization and particularization. The hype for exclusive classes has always been a hindrance to me. I prefer kinds to classes. However, not much programming will be affected by lacking multi-inheritance, whose implementation I suspect may complicate matters a lot (compiler, memory management, optimization...).

  • @koalakid3609
    @koalakid3609 10 หลายเดือนก่อน

    How do I run the code? for lobster

  • @porky1118
    @porky1118 ปีที่แล้ว +1

    8:15 That's just what the Scopes language does.

    • @porky1118
      @porky1118 ปีที่แล้ว +2

      8:55 Oh, I never thought, this is one of the coolest features of Scopes. Even if I like that feature, it didn't seem that special to me.
      The coolest feature of Scopes, despite having a bunch of fancy features, is the handling of references:
      - if a is a reference, a.b is a reference, even if you assign them to a temporary name
      - if a is a value, a.b is a value
      - you can only assign to references, values are immutable
      - most of the time you don't create variables, when you create variables explicitly, they normally don't point to an existing value

  • @SabeDoesThingsChannel
    @SabeDoesThingsChannel 9 หลายเดือนก่อน +1

    you should cover the squirrel programming language.

    • @codetothemoon
      @codetothemoon  9 หลายเดือนก่อน

      thanks, I hadn't heard of this one!

  •  ปีที่แล้ว +1

    Doesn't seem to have algebraic datatypes and pattern matching?

  • @BohdanTrotsenko
    @BohdanTrotsenko ปีที่แล้ว

    3:00 these are not "structs as in C#" - there one can mutate fields

  • @mariafrancodev
    @mariafrancodev 9 หลายเดือนก่อน

    Hi, how can I run a Lobster file?

  • @guy-
    @guy- ปีที่แล้ว +1

    Lobster: 🙂
    Lobster without limbs: 😳

    • @codetothemoon
      @codetothemoon  ปีที่แล้ว

      you might have to walk me through this one :)

    • @guy-
      @guy- ปีที่แล้ว

      @@codetothemoon it's just the tail thing and the head
      Kinda phallic
      Please don't ban me off the channel or whatever, my dirty mind made stupid idea

  • @delphicdescant
    @delphicdescant ปีที่แล้ว +6

    This must not be the one for me. After most of the features shown, I found myself asking "but why?"
    Nope, I'm happy keeping Zig as my current hype language.

    • @terryriley6410
      @terryriley6410 10 หลายเดือนก่อน

      zig is not a hype language, it has curly brackets like its the 80s

    • @delphicdescant
      @delphicdescant 10 หลายเดือนก่อน

      @@terryriley6410 Spoken like a true web developer.

    • @terryriley6410
      @terryriley6410 10 หลายเดือนก่อน +1

      @@delphicdescant it's a joke. fyi indentation sensitive syntax dates back to the 60s.
      also most of the "big names" in no-curly-brackets languages are not web-dev focused: Python, Haskell, F#
      web development happens mainly in JavaScript and TypeScript, both have curly braces to denote scope

    • @delphicdescant
      @delphicdescant 10 หลายเดือนก่อน

      @@terryriley6410 Joke acknowledged. Really hard to tell what's supposed to be a joke on the internet in these post-irony times.

  • @socvirnylestela5878
    @socvirnylestela5878 ปีที่แล้ว

    interesting language to toy around with

  • @SliceOfFish
    @SliceOfFish ปีที่แล้ว +2

    > Or maybe cherry-pick the features you like and go seek them the out in other languages
    *and implement them in your yet another language

  • @AcidiFy574
    @AcidiFy574 ปีที่แล้ว

    Can you give us their official website ?

  • @HenriqueNewsted
    @HenriqueNewsted ปีที่แล้ว +1

    Which colorscheme is this in vim?

  • @kruth6663
    @kruth6663 ปีที่แล้ว

    I have a beginner question: when you talk about faster than python, does it mean faster to write, faster to compile, or faster to run? Or all of them?

    • @smallSphere69
      @smallSphere69 11 หลายเดือนก่อน +1

      Faster to compile and faster to run.
      The more low level you'll go the faster the language in those manners.
      Python < Java/pHp < C/C++/Rust < Assembly languages
      Assembly is the fastest (hardest also) among of all.

    • @kruth6663
      @kruth6663 11 หลายเดือนก่อน

      @@smallSphere69 I see, thank you for replying!

  • @wgolyoko
    @wgolyoko ปีที่แล้ว

    >Worked on Borderlands 2
    Alright, here's my guru now

  • @hansdietrich1496
    @hansdietrich1496 2 หลายเดือนก่อน

    What I never get: If you already lean on the snytax of another language: Why these arbitrary divergence, e.g. the curly brackets for instantiation? It doesn't need to be a perfect clone of python, but differing arbitrarily just makes it harder to switch.

  • @MsDuketown
    @MsDuketown 2 หลายเดือนก่อน

    The Lobster language competes Cute Fish OS with curl.

  • @joshuathomasbird
    @joshuathomasbird ปีที่แล้ว

    the cars location is actually a location on a space filling curve

  • @KrXYT
    @KrXYT ปีที่แล้ว +8

    Indentation for scopes sucks so bad

  • @HyperCodec
    @HyperCodec ปีที่แล้ว +2

    Looks interesting

  • @oleksandr.kryvonos
    @oleksandr.kryvonos 4 หลายเดือนก่อน

    hi, what editor do you use ?

  • @mistical1409
    @mistical1409 4 หลายเดือนก่อน +2

    i've been trying this language for about 3 weeks but havent found any way to operate with bigInts or insanely big numbers, the closest to that is using floats but still overflows eventually, if anyone had found a way to use bigInts with the integrated libs or functions that this language has, please let me know :D

    • @codetothemoon
      @codetothemoon  4 หลายเดือนก่อน +1

      maybe check with the folks on the Lobster discord server, I think Wouter is pretty active there!

    • @mistical1409
      @mistical1409 4 หลายเดือนก่อน

      ​@@codetothemoonwow, i didnt knew there was a discord server, please, may you tell me where to find the link? hope i dont bother you, and thanks!!

    • @codetothemoon
      @codetothemoon  4 หลายเดือนก่อน +1

      discord.gg/szJPYdX@@mistical1409

    • @mistical1409
      @mistical1409 4 หลายเดือนก่อน

      @@codetothemoonThank you very much!! you earned a new sub! :D

  • @xeschire706
    @xeschire706 ปีที่แล้ว

    I thought this programming languages main method of memory management is compile time "static reference counting" & not some automatic form ownership & borrowing?

  • @DarkblooM_IO
    @DarkblooM_IO 7 หลายเดือนก่อน +2

    So it's basically rusty Python

  • @myronkipa2530
    @myronkipa2530 ปีที่แล้ว

    What's the font?

  • @PatrickSteil
    @PatrickSteil ปีที่แล้ว +3

    Compiled Python! Awesome!

    • @xybersurfer
      @xybersurfer ปีที่แล้ว +1

      more importantly, statically typed

    • @PatrickSteil
      @PatrickSteil ปีที่แล้ว

      @@xybersurfer Agree!

  • @leschopinesns100
    @leschopinesns100 ปีที่แล้ว +14

    It's so funny when he says "this language has the inference you would expect from modern language, and even more !", ML languages have the same inference and they're 40 years old.

    • @WoutervanOortmerssen
      @WoutervanOortmerssen ปีที่แล้ว +6

      Not quite, they're based on "Hindley Milner" type inference which has the downside that inference breaks down if it can't infer generic types for ALL callers of a function.. and if it can, all those types need to go through that generic representation, potentially making things really slow. That's what you need type classes in Haskell for. Lobster can deal with wildly different types without a common super type or type class, and also be more efficient for each caller.

    • @leschopinesns100
      @leschopinesns100 ปีที่แล้ว +2

      @@WoutervanOortmerssen I'm not sure to get it all. I looked up "Hindley Milner type system" and it seems really interestng. What you're saying is Lobster has another way of infering types, which is more efficient ? That makes me curious about it.

    • @AnthonyBullard
      @AnthonyBullard ปีที่แล้ว +3

      @Wouter van Oortmerssen could you talk more about Lobsters type system? Is it on the web site?

  • @rvdende
    @rvdende ปีที่แล้ว +1

    April 1st right

  • @adilsongoliveira
    @adilsongoliveira ปีที่แล้ว +2

    You lost em at the indentation. I don't know why but I simply cannot work like that, that's why I've never used python. I know it's weird but this kind of feature makes me very uncomfortable, maybe because my background is C, Pascal, Ada and Prolog.

    • @codetothemoon
      @codetothemoon  ปีที่แล้ว

      I probably did! I personally enjoy indentation for scoping, but I can totally relate to the arguments against it

    • @xeschire706
      @xeschire706 ปีที่แล้ว

      Probably because, or at least what I'm thinking anyway 🤔, is they always fail to tell you, for some ridiculous reason, when using a programming language that uses indentation for scoping, to never, ever mix tab indentation with space bar indentation in a language like python, where it expects consistent indentation types for it's scopes, unlike the C-like languages that use my least favorite thing that I think is time waster, curly braces to handle scopes.
      Gosh darn, if I had known that python treats tab based, & space bar based indentation differently, & actually discourages the use tab based indentation anyway, that one detail in the indentation rules that's easy to overlook, that would have saved me from receiving the dreaded "indentation errors" that left me scratching my head, wondering, how? What did I do wrong, when this looks correct! I would have not gotten demoralized so fast when I was learning to code since I was 14 years old, & probably would have advanced far enough to create my own memory safe programming language, & maybe even my own os, wayyyy sooner, maybe even started coding for the Arduino as well at a younger age! 😅

    • @xeschire706
      @xeschire706 ปีที่แล้ว

      ​​@@codetothemoon I think the arguments against indentation for handling scopes are very silly, because they most, very likely overlook the fact, that you should never mix tab based indentation, with space based indentation in these types of programming languages, which makes me wonder 🤔, why on earth does tab based indentation have to be different from space based indentation, instead of making tab equal four space in python, or similar language? Would prevent all of the dreaded "indentation" errors, especially when programmers, are very used to using tabs & space in conjunction with one another while coding?
      Anyway, to me, the only really valid reasoning to be against indentation for code scoping, can only be within the realm of personal preference/taste, & nothing more whatsoever.

  • @Mik1604
    @Mik1604 ปีที่แล้ว

    So the signature for instantiating an object depends on whether a default value was specified within the class? That is just all kinds of horrible.

  • @renghenkow
    @renghenkow ปีที่แล้ว +7

    lots of nim vibe in lobster

    • @codetothemoon
      @codetothemoon  ปีที่แล้ว +2

      definitely!

    • @T1Oracle
      @T1Oracle ปีที่แล้ว +2

      Nim? 🤔

    • @renghenkow
      @renghenkow ปีที่แล้ว +3

      @@T1Oracle nim programming language

  • @gamcd
    @gamcd ปีที่แล้ว

    Aren’t structs also passed by reference but act as if it was by value because they are immutable?

    • @WoutervanOortmerssen
      @WoutervanOortmerssen ปีที่แล้ว

      they are actually passed as a copy at an implementation level, which is actually faster for the common use case of 2d/3d vector types.. they could be made mutable, just haven't gotten to that

    • @gamcd
      @gamcd ปีที่แล้ว

      Good to know thank you!

  • @doigt6590
    @doigt6590 ปีที่แล้ว +1

    C++ doesn't have structs the same way C# structs or Lobster structs work. In C++, structs are just classes where members are public by default.

    • @codetothemoon
      @codetothemoon  ปีที่แล้ว +3

      What I meant is that Lobster has both structs and classes, not necessarily that they work the same way. I definitely could have worded that in a less ambiguous way!

  • @ConnorMcCormick
    @ConnorMcCormick ปีที่แล้ว +1

    I really like how for and while loops aren't language level. Means you could make your own
    LOVE the argument hoisting
    The underscore thing is klugey for sure
    what do multiline anonymous functions look like? Do they require `return` or is it just the last line

    • @notkamui9749
      @notkamui9749 ปีที่แล้ว +2

      seems like the last line of lambda functions are the returned value. See the map example. A mapper should return a value, but no return was written, so I would assume my theory is correct
      as a matter of fact, he never showed us how to return from a normal function either, and I think it might be the same thing, for consistency. Like Rust, I would also assume you still can add the return keyword, for early returns for example

    • @WoutervanOortmerssen
      @WoutervanOortmerssen ปีที่แล้ว +2

      @@notkamui9749 that is actually different, you use `return` for a named function, and last exp for a lambda. But why, do you ask, well, because `return` inside a lambda allows you to return from the enclosing named function! This truly allows lambdas to function like the body of a control structure. In other languages, you can write your own "for" loop using a lambda, but you'd have no way to break/return from that iteration

    • @michaelsydenham2918
      @michaelsydenham2918 11 หลายเดือนก่อน +1

      re: 'underscore thing is klugey', the author appears to be considering using something else instead of _ for namespaces, as per his todo list on github.

  • @ongteckwu1725
    @ongteckwu1725 ปีที่แล้ว

    The video is only focused on syntax, so I will focus my critique on syntax. There are a few things I like and dislike about the syntax, with one I absolutely despise.
    The few things I like are the explicit auto-binding of class to functions with :: . I kinda like it. But I dont think Id allow it in a multi-contributor repo though.
    I also like the alphabet-style lambdas. Very cool.
    I dont really favour the implicit class auto-binding (without the ::). It’s cool though, but it allows method calls to be strewn all over the codebase. Not good for ergonomics.
    Now to the dislikes.
    I dislike the currying (actually currying in general). Makes it difficult for reading. Maybe I will get used to it. I hope.
    The one I really despise is the implicit imports, because it will be very hard to figure out where the function came from, unless you have a tool to do so. I do like dependency injections, but not this level of implicity.
    Overall, the things I dislike are the implicits, but in general it is still usable, since most of the things I dislike can be disabled at lint-time.

  • @cbbcbb6803
    @cbbcbb6803 ปีที่แล้ว +1

    We need eight billion programming languages, each one customized for each one of the eight billion of us on planet Earth. Each language would have to conform to the personality and personal preferences of each individual user. We all have personal tastes, and deserve to have them respected.
    For example, when coding a class, I would prefer something like "class ... end-class" instead of making spaces, tabs, and line feeds the equivalent of reserved words. Even if I am wrong, I would still prefer something like that.
    "if ... end-if" "function (fn) ... end-function (end-fn)".
    And I prefer hyphen (-) over underscore (_). The underscore is not a space. No one is fooled by it.

    • @codetothemoon
      @codetothemoon  ปีที่แล้ว +1

      You speak in jest, but the funny thing is that language models should conceivably allow anyone to create their very own programming language on a whim. Not sure if that is a good or bad thing 😎

    • @cbbcbb6803
      @cbbcbb6803 ปีที่แล้ว +1

      @@codetothemoon Or, am I speaking in jest? 😏

  • @MichaelSh
    @MichaelSh ปีที่แล้ว +2

    Is this being transmitted from the alternative reality where C# does not exist?

    • @codetothemoon
      @codetothemoon  ปีที่แล้ว +2

      What’s C#??

    • @MichaelSh
      @MichaelSh ปีที่แล้ว

      @@codetothemoon ha-ha! I knew it! :)

  • @jikrochmal1174
    @jikrochmal1174 ปีที่แล้ว +1

    Very cool language! The title is misleading though as C already exists.

  • @mikopiko
    @mikopiko ปีที่แล้ว +6

    Interesting

  • @dlinnoedlinnoe
    @dlinnoedlinnoe ปีที่แล้ว

    It seems that the second parameter of 'for' is not a real fn (15:15), but some kind of 'block'
    for(3) i: print("1: {i}") // ok
    def f1(i): print("2: {i}")
    for(3,f1) // error: `)` expected, found `,`
    so I believe such inline blocks (used everywhere in Lobster) are not real fns. And that is great of course, no need for real fns there and I hope the code is optimized and everything is inline (although I didn't study that yet).
    All in all, the language is quite close to my ideal, maybe with some changes it can be.

    • @dlinnoedlinnoe
      @dlinnoedlinnoe ปีที่แล้ว

      btw how do you do this in Lobster?
      def double(x): return 2*x
      def apply(f,x): return f(x)
      print(apply(double,3)) // can't use named function `double` as value

    • @dlinnoedlinnoe
      @dlinnoedlinnoe ปีที่แล้ว

      aha, I see...
      let double = fn x: 2*x // , although can't print def'd fn
      print(apply(double,3)) // 6 i.e. ok, although still can't do for(3,...) with such 'FUNCTION'

  • @kiyasuihito
    @kiyasuihito 9 หลายเดือนก่อน +1

    I'm already sold 🎉

    • @codetothemoon
      @codetothemoon  9 หลายเดือนก่อน

      it's worth checking out at least!

  • @Peanut-qw8ny
    @Peanut-qw8ny ปีที่แล้ว +1

    I haven’t watched the video so I have no idea what it is. But there can’t be two crustaceans in the sea.

    • @codetothemoon
      @codetothemoon  ปีที่แล้ว

      apparently there is Shrimp too! www.chandoo.de/shrimp/#start seems to be a crowded space lol

  • @arcticyeti1
    @arcticyeti1 3 หลายเดือนก่อน

    Oh cool they're releasing python 4

  • @gJonii
    @gJonii ปีที่แล้ว

    No namespaces it seems? Import std just put the map in the current namespace. It's one of those small things Python does right that for some reason every other language seems to insist on doing wrong.

  • @Dev-Siri
    @Dev-Siri 9 หลายเดือนก่อน +1

    we don't need anymore crustaceans. can we have a mollusc based language now?

    • @codetothemoon
      @codetothemoon  9 หลายเดือนก่อน

      hah yeah the crustacean programming language field is getting a bit saturated! 🦀

  • @9SMTM6
    @9SMTM6 ปีที่แล้ว +3

    Huh. At first I thought this was a late April 1st video.
    Gonna add a few comments as the video goes on:
    * Yeah I like Python syntax
    * not a big fan of the lacking mutability controls. Making that the difference between class and struct... I don't know another language that does that, I'd prefer a more general system.
    * default values are nice. Not sure if I like the fact that you HAVE to specify it during instanciation, but I could see it grow on me
    * ouch Inheritance. Having learned both Rust + Java thoroughly ruined Inheritance for me. Java shows the bad sides of inheritance, and Rust shows that you can do without, without it causing major issues, with stuff like generic trait implementation covering most of what I need. The situations where Rust is lacking a bit are caused by coherence constraints - like the orphan rule - which one could relax in an "easier" language like this one.
    * unqualified access to argument fields/methods: Yeah not sure on that either... Javas implicit shadowing with the implied this has already caused many headaches for me. I mean, at least it's opt-in, but making that decision on the whole method body... Not a fan. I get that this can be very helpful, I too am at times annoyed at constantly having to write self in Rust. But I'd like the ability to constrain this more. Like how you can do "use Enum::*" in Rust and constrain to a block {}.
    * ah, that is C++ style of static checking for "generics". C++ does this mostly in a way that is problematic, would have to see how well this language does. Rusts requirement to explicitly declare used interfaces can be annoying, but it leads to REALLY nice compiler errors, and also, with C++ I've often created long methods just to find out that the type I wanted to call it with does not fulfill all the implicit requirements. That form of delayed compiler error happens only with lifetimes in Rust.
    * GODDAMMIT LANGUAGES STOP CALLING LISTS VECTORS.
    * don't particularly like elif. Much harder to parse for a human than a switch (or Rust match, Kotlin when). Also, is that an expression? Don't really want to miss controlflow expressions anymore.
    * uhh. No implicit namespacing with files... Not a fan.
    * oh wow, when continuing... They really fucked up namespaces.
    * Memory Management: So how is this different from Swift? Sounds to me very similar to what that language does. And many others, just that these others use GC as fallback. Swift also only has Reference counting fallback, I'm fairly certain. So this sounds like Swifts system with Rusts terminology

    • @WoutervanOortmerssen
      @WoutervanOortmerssen ปีที่แล้ว +2

      * structs are copied always, so making field mutable could be confusing with users not understanding why their changes don't perculate.. I already had the plan to allow optional mutation of struct fields, which could go along with optional non-mutation of class fields, but the use cases for that are rare (in gamedev)
      * not a fan of inheritance either, but at least in games it makes it really easy to specify what you need.. the lack of it in Rust is not popular with everyone, or so I have heard.
      * Unqualified access: this simply mimics what happens in most languages in "methods", just in Lobster they can be written separate from the class they apply to. Personally would not enjoy writing `self.` all over the place, but to each their own :)
      * Yes it is monomorphisation like in C++, but in a language that is WAY simpler, and thus the compile time errors that result never get to C++ wtf level. And it is super easy to add some explicit types along the chain if you want to reduce it even further.
      * Sorry, hold-over from having worked with `std::vector` for an eternity. I agree it would be good to change since it is confusing with 2d/3d vector types.
      * There is a switch too, and a rather nice one at that (allows ranges etc).
      * Not sure what you mean with "namespacing with files".. ah I guess the fact the namespace automatically ends at file end instead of needing to indent the whole file?
      * namespaces were such because _ was already used everywhere in an ad-hoc way to indicate namespaces.. agree its a weak spot and will think of alternatives.
      * Swift afaik does not have anywhere near the whole-program analysis to completely elide refc ops like this does.

    • @TijmenZwaan
      @TijmenZwaan ปีที่แล้ว +1

      @@WoutervanOortmerssen I assume by "implicit namespacing with files" he means that if you don't specify the namespace, the contents of a file are automatically assigned to the namespace that's the same as the name of the file.

    • @WoutervanOortmerssen
      @WoutervanOortmerssen ปีที่แล้ว

      @@TijmenZwaan except that doesn't happen in Lobster.. if you don't specify a namespace it is simply in the global namespace, like most languages, independently of filename or path

    • @TijmenZwaan
      @TijmenZwaan ปีที่แล้ว +1

      @@WoutervanOortmerssen I didn't mean it happened in lobster. The OP said "No implicit namespacing with files", as in, it does not have that feature.
      I was simply making a guess as to what I thought he meant.

    • @9SMTM6
      @9SMTM6 ปีที่แล้ว

      @@TijmenZwaan yes, that is what I meant. With some languages, eg. Rust, but also Python, you map files to namespaces by default. If you want to, you can avoid this namespacing with wildcard or element imports.
      IMO that is strictly better than all alternatives (as long as wildcard imports and reexports exist). So no reason not to do it.

  • @mojt_ba
    @mojt_ba 6 หลายเดือนก่อน +1

    What is that font

    • @codetothemoon
      @codetothemoon  6 หลายเดือนก่อน +1

      I think this one was Monaco. But at some point I switched to FiraCode Mono, I struggle to pinpoint exactly when that was but I think it *might* have been after this video

    • @mojt_ba
      @mojt_ba 6 หลายเดือนก่อน

      @@codetothemoon Thank you

  • @jantoko
    @jantoko ปีที่แล้ว

    This mean, Rust will take system seriously. it might there is an interpreter on top of rust.

  • @carlfranz6805
    @carlfranz6805 ปีที่แล้ว +1

    What is the point of having a 'struct' that is immutable?

    • @codetothemoon
      @codetothemoon  ปีที่แล้ว

      Same reason you'd have any immutable value - you know the value(s) when it is initialized, and you'd like to guarantee they won't change after that. Eliminates potential synchronization issues, opens the door to compile time optimizations, erroneous mutation of the fields, etc

    • @carlfranz6805
      @carlfranz6805 ปีที่แล้ว

      @@codetothemoon I think you may have missed my point. While I agree that an immutable struct can be useful... Your example is one such case, but only one. An immutable struct is just an accumulation of constants. A struct can be used for far more cases then just that. Back in the olden days we used them for IO amount other uses. They can be very useful for database records which are notorious for needing changes and writing back to the database..