I don’t need something practical. I just need something fun to keep me motivated.

  • Caveman@lemmy.world
    link
    fedilink
    arrow-up
    1
    arrow-down
    2
    ·
    3 hours ago

    Just pick a thing you want to work on. If it’s a website it’s JS/TS, if it’s a terminal app then python (or JS/TS). If it’s a desktop app then I’d personally say C# but opinions vary wildly. If you want to do something embedded (microcontroller) then C, Zig or python. If it’s a mobile app then Swift for iOS, Java/Kotlin for Android or Dart/Flutter.

    Honestly, python is IMO the best to get going unless you want to make a website then it’s JS/TS.

    Web frameworks can be fun to learn but it might be a bit much to start out but making an Astro blog is easy and fun. If you want to spice it up to a Web app then I recommend Vue even though I work with angular and know react.

    But yeah, I recommend python to most beginners unless you want your first thingy to be a website.

  • Mikina@programming.dev
    link
    fedilink
    arrow-up
    8
    ·
    15 hours ago

    I’ve seen a lot of technical recommendations, but what I found most fun to experiment with is visual/art/music stuff, so here are some recommendation if that’s also your thing. It’s not strictly programming, because most of it requires learning more skills than just that, but I see that as an advantage. YMMV, though.

    The Book of Shaders is and extremely good introduction to some basic shader stuff. Especially thanks to the interactive editor they have in their tutorials, and web tools like Shadertoy, experimenting with shaders is easier than ever. It was the tutorial that made me finally get past the “super confused” part of learning shaders.

    It’s kind of math heavy, especially once you get into 3D stuff, but I find it fun to learn, plus it’s a rabbit hole and you can do some pretty cool stuff once you get into it. In general, anything technical artist related is interesting.

    Another thing I’d recommend is looking into Algoraves. Algoraves are live performances where both visuals and music is performed by people live-coding their tracks and projections in some kind of language that’s made for the task. TidalCycles, one of the libraries/languages that’s commonly used, has a web editor, and there’s also Sonic Pi, although I’ve never tried that one.

    Processing is another language/tool used for making visual art. It also has a web edittor (with a lot of tutorials), and can make some cool visual stuff that can be fun to learn.

    And one last recommendation, this time not about art, but about learning/building your CPU, your own assembly language, and learning to do stuff in it! Turing Complete is a puzzle game, where you will learn how to build your own CPU, starting from a single NAND gate, slowly combining them into registers, memory, adders, ALU, up until you have your own, complete and working CPU. You then create your own instruction set and use your CPU to solve a few puzzles.

    It’s super fun and engaging, and I’d consider learning logic gates and building a CPU as kind of also programming.

  • PortNull@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    6
    ·
    15 hours ago

    Elixir. Especially with OTP to write distributed systems. Or with phoenix and liveview for web apps

    It’s a functional language based on Erlang with a nicer syntax

      • wet_bones@lemmy.4d2.org
        link
        fedilink
        English
        arrow-up
        2
        ·
        3 hours ago

        It’s a lot like Ruby syntactically and visually but it’s super easy to learn and start doing useful stuff in quickly. The combination of functional and declarative programming make for a very nice developer experience.

      • PortNull@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        1 hour ago

        I can’t comment as I’ve not used scheme but looking at scheme’s syntax, elixir is much nicer. It’s supposed to take some of its inspiration from Ruby.

        The big seller is that it runs on the Erlang VM so you get all the goodies for free: supervisor trees, OTP, processes, even able to call Erlang directly. It is both scriptable and compiled. Not so much suited for high performance computing though as benchmarls will show, but it is interesting to learn and I have gained a lot from exposing myself to functional programming paradigms.

        https://elixir-lang.org/

  • nomecks@lemmy.wtf
    link
    fedilink
    English
    arrow-up
    7
    ·
    20 hours ago

    Lolcode:

    HAI 1.2
    
    HOW IZ I FIZZBUZZ YR INPUT
        I HAS A RESULT ITZ A YARN
    
        I HAS A FIZZ ITZ MOD OF INPUT AN 3
        I HAS A BUZZ ITZ MOD OF INPUT AN 5
    
    • ageedizzle@piefed.caOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      18 hours ago

      Reminds me of that language where all the syntax is a quote from an Arnold Swartznegger movie

  • DaPorkchop_@lemmy.ml
    link
    fedilink
    arrow-up
    6
    ·
    23 hours ago

    This is probably an unpopular opinion, but I find modern C++ with templates and constexpr to be quite fun, mainly from the perspective of trying to do as much at compile-time as possible. Most of the resulting code is nearly incomprehensible and never gets used for anything outside of a godbolt demo, but trying to do complex tasks within the limited and unintuitive world of compile-time evaluation is something I’ve never really been able to find in any other language.

    i don’t want to hear about rust, const generics are almost useless and you know it, specialization isn’t really a thing and nothing like variadic templates exists yet

    • orclev@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      3 hours ago

      You should check out Zig’s macro system, I think you’ll find it really interesting.

  • Riskable@programming.dev
    link
    fedilink
    English
    arrow-up
    7
    ·
    1 day ago

    Easy: CircuitPython running on an RP2040 or RP2350 microcontroller. Being able to write a simple bit of code and have it control something in the real world is sooooooo satisfying. OMG: You’ll jump for joy the first time you get it controlling some LEDs, a display, a servo, a motor, etc.

    Programming a microcontroller for the first time was definitely the most fun I ever had when programming. CircuitPython makes it so easy, too! Oh if only it had existed back when I started learning electronics.

      • Riskable@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        3 hours ago

        You’ll want to get an electronics starter kit. There’s zillions of them.

        Having said that, the easiest hardware to work with is the rp2040 (RPi Pico) and rp2350 (RPi Pico 2). It’s got USB mass storage support built in which is about as easy as it gets and it does everything and you can use just about any pin for any thing. It really is awesome.

        If you can’t find a kit that includes the RPi Pico (or Pico 2) just get a regular kit (e.g. Arduino) and a Pico separately.

        Note: I just found this neat thing… https://a.co/d/05qypEzY it looks like it’d be super easy to learn with but you miss out on learning how to use a breadboard but that’s no big deal (you can just do that later).

    • BonkTheAnnoyed@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      4
      ·
      1 day ago

      100% agree! I write enterprise monsters for a living, in a bunch of different languages, and by far my favorite thing to do is make blinken-lights and other doohickies with my Arduino.

      Doesn’t have to be Python or even the Arduino subset of C++, though. I like to use Go (tinygo.org) for anything that it will compile on

    • Frenchgeek@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      1 day ago

      That reminds me I should finish that IR remote to USB keyboard translator I started… (I wonder if i can use the arrows on the remote to control the mouse pointer too…)

      • Riskable@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 day ago

        My AHEK-95 keyboard has an IR receiver and I programmed it with a cheap $0.50 remote. I only set it up to send the play/pause, next/prev, and volume control but in theory I could make it work with a huge universal remote to do whatever I want.

        There’s a demonstration of it working to send some numbers here: https://youtu.be/iv6Rh8UNWlI

  • orclev@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    1 day ago

    So, I can’t answer the question of “what’s the most fun language to learn” because that’s highly subjective and my answer almost certainly wouldn’t align with your experience. What I can do though is share my thoughts about different languages I’ve used over the years (in no particular order).

    • Assembly: the bedrock upon which all other languages are built. If you want to understand how a computer really works, this is a great language to learn, and it’s honestly not that hard to learn. Writing something in assembly much more complicated than hello world is incredibly painful because of just how much you need to do and really makes you appreciate how much you get out of the box with other languages, but it’s not hard in the “I don’t get it” way, so much as “oh god, that’s only 1% of what I need to do and it took me an entire day”. This is also a great way to develop a deeper understanding of pointers and memory management.
    • C: assembly on steroids. Not quite as painful as assembly because you get a lot of libraries that take care of things for you, but still quite tedious compared to most other languages. The type system such as it is is practically nonexistent so your ability to design APIs is highly limited, and it’s incredibly easy to introduce subtle and hard to find bugs. Relatively easy to learn, hard to master, and an act of masochism to use for large projects. At a minimum probably worth learning because C is the de facto interop language any time you want to interface two different languages together.
    • C++: C with the entire kitchen sink of comp. sci bolted on top of it. There’s a good language in there somewhere, it’s just buried under decades of terrible ideas and half baked experiments. If you know which are the “good parts” and which are the parts to ignore it’s not bad, but figuring that out is far from a trivial task and everyone you ask is going to have a slightly different answer. I’d honestly say avoid this one unless you want to spend a couple years exploring all its dark corners and forgotten nooks.
    • LISP (and derivatives like Scheme): ye old functional language. This is basically the assembly of functional programming. It’s “simple” to learn, but the lack of features is going to start to grate on you after a while, and the syntax is just horrible. Absolutely worth learning to learn to think functionally, but once you do I’d move to a better language.
    • Haskell: Like LISP but with a masters degree in set theory, a MUCH better syntax, and one of the absolute best type systems ever created. Amazing language that will expand your mind just from learning it but might kill you from a brain aneurysm in the process. To abuse a meme, this is the dark souls of functional programming.
    • JavaScript: A badly designed scripting language that was thrown together from a box of scraps in a cave, but rather than making it better over the years everyone just said “eh, good enough”. Its original sin was that in an attempt to make it “beginner friendly” they made the syntax incredibly sloppy which means it’s very easy to introduce bugs on accident and then very hard to actually find them because they don’t error, they just silently do the wrong thing.
    • Typescript: A better JavaScript in every metric. At the end of the day under the hood it’s still JavaScript at runtime so it can only do so much, but the addition of a real type system goes a LONG way towards making JavaScript more bearable to work in and helps eliminate a ton of bugs.
    • Perl: What LISP is to functional programming, Perl is to basic collection types. Scalars (single values), Lists, and Maps are your building blocks in Perl. It’s not a bad language exactly, but these days other languages do almost everything it does but better. If there’s one significant criticism you could level on Perl it’s that the syntax is really easy to abuse to write some truly obtuse code. This is effectively a dead language these days, but it does live on a little bit by being the gold standard in regular expression design that everyone else just copied.
    • Lua: One of if not the best scripting languages currently out there. It’s very similar to Perl except it went all in on Maps. It’s simple to learn, and simple to master, although that comes with the downside that it’s nowhere near as powerful as other languages. Out of the box you don’t really get much with it, but since it’s designed to be embedded it’s really easy to extend and there are versions of it that come with all the bells an whistles you need to use it directly for writing apps. I’m not sure I’d recommend it over another language in general, but if you’re looking for a scripting language to embed in something else it’s my top pick. The web ecosystem would be a lot less of a mess if Lua had been the language picked at the dawn of the internet instead of JavaScript (to be fair I’m like 99.9% sure Lua didn’t exist back then but I’m too lazy to verify that).
    • Python: A competent language. It’s not a particularly great language and definitely has some warts, but there’s not really anything in the language that makes me go “ewwww” except maybe the significant whitespace, although Haskell does the same thing so it would be hypocritical of me to ding Python for that. It’s a solid middle of the road language, nothing really amazing about it, but nothing really bad either. It’s biggest flaw is its duck typing system which really limits your ability to write APIs in it. If you want to crunch some numbers it has some really great data analysis libraries and frameworks, although performance isn’t anything to write home about either.
    • Ruby: The train wreck that happens when Perl crashes into Python and the mangled remains crawl from the wreckage. It’s the terrible syntax of Perl crossed with the middling type system of Python with a sprinkling of bad choices all its own. Performance is horrible and the language has a lot of features that make it easy to write obtuse code. Like Perl this is an effectively dead language. Just use Python or something better.
    • Go: Created in part by one of the guys involved in the creation of C and set out to be a “simple” language that anyone could learn. It does succeed in being simple, but the tradeoff is that it pushes all the complexity that most other languages handle for you onto the programmer to handle. Go programs are going to end up being a lot more verbose and filled with boilerplate than they would be in another language. It also still suffers from an early decision related to its generics system that leads to them being largely useless. Not unsurprisingly working in Go feels a lot like working in C, you often find yourself wishing the language handled a bunch of things for you or at least gave you some syntactic sugar to handle them more concisely yourself.
    • Java: Has a reputation for being verbose but that’s more to do with the community than the language itself. Also has a reputation for being slow, and while startup times are certainly a problem at runtime it’s surprisingly fast these days. Not a great language, but nowhere near as terrible as its reputation would make you think.
    • Kotlin: Java alternative. Solves some of Javas problems, introduces some of its own. At one point it was the clearly superior choice compared to Java, but since then Java has closed the distance and honestly it’s a coin flip as to which is the better language between the two.
    • C#: Microsoft Java. Seriously, everything you can say about Java applies equally to C# and vice versa. It’s not a better or worse language, it’s just different. Criticisms of C# are less about the language and more about the company behind it.
    • Rust: A type system nearly as powerful as Haskell’s, low level primitives that let you write bare metal code, but advanced abstractions that let you write high level code as well, and a truly unique approach to addressing concurrency and memory safety by way of the ownership system. One of the more interesting languages out there and my personal pick for “best” language because it gives you tools to solve some of the hardest problems to deal with in programming.
    • Zig: A better C. Has a somewhat powerful type system a bit like Rust or Haskell as well as a pretty unique and interesting macro system, but ultimately lacks some of the higher level features that something like Rust would give you. It’s similar to C in that it it can be somewhat tedious to work with but on the whole not a bad language.
    • ulterno@programming.dev
      link
      fedilink
      English
      arrow-up
      4
      ·
      edit-2
      23 hours ago

      Assembly: … but it’s not hard in the “I don’t get it” way, so much as “oh god, that’s only 1% of what I need to do and it took me an entire day”. This is also a great way to develop a deeper understanding of pointers and memory management.

      Well explained.
      Although I understood memory beforehand, I found the little bit of Assembly I did pretty useful in getting a better understanding. This also ended up opening me to think of how multithreading worked underneath.


      I found C pretty fun, but that might be my bias.
      It was fun because it felt pretty close to hardware and let me understand how stuff can go wrong, without tripping me into it (the last part is subjective. I suppose most people would feel having been tripped, when using C).

      C++ was fun and useful as long as I thought of it like C. Once I went into software development and had to make sure stuff worked out well on top of mistakes that might come out of collaboration, I had to start considering things like smart pointers almost all the time and it was no longer as much fun.

      Rust is definitely not going to give the fun of C. Although it is more desirable for Software Development, when you start learning it, you will find quite a few blockers, that you might feel unreasonable. Me, even after having used C and C++ and realising the problems faced when making software and then having seen proper explanations of the features of Rust, still have a problem with the feeling of it.

      Python: if you just want to do some mathematics on computers, this will be more desirable. The “fun” for this one is that you don’t need to worry as much when doing some scratchpad stuff. Start going big though and it stops getting any fun, pretty fast.

        • orclev@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          4 hours ago

          So, there’s not a great answer to that. The big problem is that x86 assembly is painful because the x86 instruction set is a weedy overgrown mess due to being built on top of literal decades of cruft. Even a CPU made today starts off by booting up pretending to be an 8086 processor, a 16 bit CPU from 1978. To get to a “modern” operating mode you need to walk through a series of configuration steps to get the CPU into the correct mode, but all those modes and configs add a lot of noise when trying to understand x86 assembly. For that reason it’s probably a good idea to start by not learning x86, but instead the far more minimal and sane ARM assembly.

          The problem of course is that there’s like a 99% chance that the system you’re going to be working on when learning assembly is an x86 system not an ARM one. So now you need two more things, you need an assembly cross-compiler to use your x86 system to build an ARM executable, and you need an ARM emulator to run it. Personally I’d install LLVM (specifically clang) and start by writing a small C wrapper with some inline assembly in it. For running it I’d use QEMU and a Linux ARM image (maybe one of the raspberry pi distros).

          Finally allow me to introduce you to one of the absolute coolest tools out there godbolt compiler explorer. Godbolt allows you to take a snippet of code written in one of dozens of supported languages and see the assembly instructions that various compilers would produce from that code. This is a great way to learn more about not just assembly, but any of the supported languages and is also an invaluable tool for doing fine grained optimizations.

        • ulterno@programming.dev
          link
          fedilink
          English
          arrow-up
          3
          ·
          11 hours ago

          IDK really, perhaps you can use a book.
          I mainly did it in the 8085 practicals during B.Tech and they had a handy learning kit with a HEX keyboard so we could Assemble it manually on paper, write the program directly to a given RAM address and then run it from there. For ARM, we just used Keil µVision.
          Now I just download an x64 instruction manual or just look up the instructions on the web, on the occasional requirement of reading disassembly.

          I don’t recommend starting with x86_64 reference. While it can be used just fine, it has lots of instructions and and you instead want a very small subset of them.


          Also, there will be a great difference between using an OS and not doing so, as going with one, then includes a lot of potential boilerplate.

    • ageedizzle@piefed.caOP
      link
      fedilink
      English
      arrow-up
      8
      ·
      2 days ago

      Haha thats great. Thanks for the taxonomy of fun. I have been trying to learn Rust but I find the payoff is still a ways away, so something to keep me going in the meantime would be good. So I guess 1 is the way to go, because if I want to keep going back then that’s good motivation.

      • orclev@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        2 days ago

        I’m curious what you mean by the payoff being a ways away. Do you feel you don’t understand some aspect of Rust well enough to write anything in it?

        As a tangent to that and your original question what languages do you already know? Understanding where your knowledge is lacking could help provide better answers as what languages someone enjoys learning/using tends to change a lot as they become more experienced and start to develop an appreciation for the more complicated problems more involved languages help solve.

        • ageedizzle@piefed.caOP
          link
          fedilink
          English
          arrow-up
          3
          ·
          2 days ago

          I feel like the payoff is a ways away because, I write something that should work, but then I need to wrangle with the compiler for sometimes multiple days just to get it to work. To answer your second question, I know a very small amount of Python and some Typescript, but I’m mostly familiar with Javascript. I do think that is part of what’s going on here. Javascript is super losey goosey and not typed. So then my brain translates Javascript code to Rust and it just leads to total chaos.

          • orclev@lemmy.world
            link
            fedilink
            arrow-up
            6
            ·
            2 days ago

            Aaaah, yeah. You’re struggling with thinking in terms of types and scopes and probably also a tiny bit of stack vs. heap allocation. Javascript side steps most of the concurrency problems by having a single threaded runtime, and of course is a garbage collected language so you never really need to worry about memory management either.

            Rust is a much more powerful language, but of course with power comes responsibility. The compiler believe it or not is actually helping you a lot even though it probably doesn’t feel like it. In something like C you’d probably be able to successfully compile those programs that Rust refused to build but then you’d get crashes and weird bugs when you ran the program with very few clues on where you made a mistake.

            Fundamentally here’s the difference. Javascript is making the tradeoff that it will worry about a lot of the details for you, but it will get them wrong a lot and performance will suffer as a result. It also doesn’t give you a lot of ability to express your problem well due to its incredibly primitive type system which will lead to a lot of bugs that are very hard to diagnose.

            Rust on the other hand says you need to worry about the details but it will give you some tools to make managing them easier to the point where you can ignore them a lot of the time. E.G. most of the time you can just stack allocate your variables and not worry about heap allocation and the headaches that can introduce. But the tradeoff for that is you can get some of the best performance out there and its advanced type system lets you model problems in ways that make bugs far less likely and much easier to diagnose and fix.

            Rust doesn’t let you write code that works 90% of the time but fails 10% of the time, it forces you to write it in a way that works 100% of the time. This is particularly true for concurrent code where Rust prevents (mostly) race conditions that nearly every other language lets you write. If you’re thinking some code that should work isn’t compiling it’s almost certainly because that code would fail with some kind of race condition under concurrency. The good news is once you start to understand where these problems crop up it’s usually easy to resolve them by putting a Arc or RwLock wrapper around something or maybe just a simple .clone() if you don’t mind the performance hit.

            • ageedizzle@piefed.caOP
              link
              fedilink
              English
              arrow-up
              2
              ·
              1 day ago

              I see. After reading your comment I can already see how learning Rust is helping me look back and better understand what Javascript is doing, too. So somethings working I guess! Thanks for your response.

          • CameronDev@programming.dev
            link
            fedilink
            arrow-up
            2
            ·
            2 days ago

            Once it clicks, rust can be type 1, it certainly is for me. But it’s definitely a long and hard type 2 to get there.

    • ☂️-@lemmy.ml
      link
      fedilink
      arrow-up
      4
      ·
      edit-2
      1 day ago

      assembly can be a lot of fun to play with if you are not making anything super serious.

      • ageedizzle@piefed.caOP
        link
        fedilink
        English
        arrow-up
        4
        ·
        2 days ago

        yeah, if you want something really esoteric check out piet. it doesn’t even use letters or numbers, the code literally just looks like abstract art

        • rumschlumpel@feddit.org
          link
          fedilink
          arrow-up
          1
          ·
          2 days ago

          Amazing, seems super annoying to use! I am definitely not the right type of person for esoteric languages, lol

  • JackbyDev@programming.dev
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 day ago

    So, if you’re brand new and want to learn concepts of how to write code, I might suggest a game. There are a lot of programming games. Obviously it’s never a one to one about learning something useful, and a lot of them even make “bad” things useful (though not bad enough to think it’s going to teach you bad habits you won’t be able to unlearn). I really enjoyed Exapunks, but it’s sort of unrealistic. The Farmer Was Replaced looks fun as well and uses a “simple Python-like” language, but I haven’t played it.

    If you sort of already understand the concepts and want to dive into a real language, well, it’s hard to say what will be fun. Chase your fun. It might be easier to think about what’s not fun and avoid languages at the start that deal with that. For example, if setting up an environment to code in is the problem, then maybe something like JavaScript would be a good place to start. It runs in your browser! Press F12, click “console”, type alert("Hello, World!"), boom, done, you just did Hello World in JavaScript without downloading anything at all.

    • orclev@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      1 day ago

      I’ll toss TIS-100 onto the list of programming games although that one teaches you a pseudo-assembly language as well as how to think about concurrent programming. Then there’s Human Resource Machine although that one is aimed at absolute beginners to programming and teaches a sort of visual assembly, and then its quasi-sequel 7 Billion Humans which extends the concepts explored in Human Resource Machine into parallel processing (this actually makes a pretty good soft introduction to GPU programming and shaders).

      I actually played The Farmer Was Replaced and it’s just straight up Python, not even Python-like, it just locks a lot of the language features behind campaign progression. It was OK initially, but gets kind of annoying at later levels because they intentionally hold back a lot of the tools to easily solve problems and make you solve them in a more verbose and annoying fashion first.

      • JackbyDev@programming.dev
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 day ago

        TIS-100 and Shenzhen IO both felt annoyingly limited to me in ways that Exapunks didn’t.

        The reason I say “Python-like” is because that’s how their store page describes it.

        • orclev@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          1 day ago

          Interesting. I did find Shenzhen IO to be a bit annoying but that was more because it forces you to use circuit design to solve certain problems rather than just brute forcing them via programming. Weirdly I couldn’t get into Exapunks while I found TIS-100 really interesting.

          I suspect the reason that they call it Python-like is because I don’t believe it allows you to import any libraries or anything into it and they don’t want people to think they’ve got a full Python interpreter that can do all the normal Python things. Essentially it’s Python syntax, but without the normal Python runtime. There’s probably some more advanced Python-isms that are missing as well, but I’ve not used Python enough or played the game enough to really run into those things. E.G. I don’t know if it lets you define new classes as I never bothered to try that. I kind of got bored of it once I got towards the later levels and didn’t really see any reason to keep grinding to unlock what were just extra challenges in the game.

  • smlckz@piefed.world
    link
    fedilink
    English
    arrow-up
    11
    ·
    2 days ago

    I don’t need something practical. I just need something fun to keep me motivated.

    People have already mentioned Lisps. So, I wont repeat that. So, let me tell you about this great one.

    Forth. And the best way to learn forth is by implementing one for yourself. There are lots of forths out there, almost as many as prolific forth programmers, I suppose. You are supposed to find your own forth. Forth is one of those rare languages (along with Lisps) where you build the language upwards to fit the problem you aim to solve, than convert the problem down to code. Here’s a blogumentary on forth for your perusal.

    It is not an easy programming language to learn. The concepts you need to understand is quite low-level. “Real” forths are usually implemented in assembly. If this sounds fun to you and you have time and patience to take the challenge, have a try.

  • Nate Cox@programming.dev
    link
    fedilink
    English
    arrow-up
    10
    ·
    2 days ago

    If you’re looking for something fun to write you might want Ruby. Literally built from the ground up with developer satisfaction as the primary goal.

    Very expressive, plenty powerful. Not my absolute personal favorite but I can’t deny it’s satisfying to use.

    Haskell or Clojure (or Common Lisp) if you want something weird but neat as alternatives.

      • Nate Cox@programming.dev
        link
        fedilink
        English
        arrow-up
        6
        ·
        2 days ago

        Weird is subjective. If you’ve only ever done C++ style object oriented programming then jumping into a lisp or a pure functional language is absolutely weird.

        • somegeek@programming.dev
          link
          fedilink
          arrow-up
          2
          ·
          1 day ago

          The language thay you are already using! You need to understand FP, not a new language. Definitely read “Grokking simplicity” by Eric Normand.

          But if you want to learn a new language more suited for FP, I would hardly recommend either guile scheme, racket, or clojure (all are lisps and you can use and build real word things with them forever). Haskell is also great but it’s much harder than lisps.

          You can do oop or fp with lisps, there is basically no syntax, you can get started and actually focusing on doing FP in a month. (Som say you can learn the language itself in a week, which you can but if you are really dedicating time to it).

        • chaos@beehaw.org
          link
          fedilink
          arrow-up
          2
          ·
          1 day ago

          I think Haskell would be a good choice. It’s mature, used for real things (amongst a particular crowd, at least) and it’s emphatic about being purely functional. Even when it is forced to enable other styles like imperative, it’s done in a way that’s syntactic sugar for a pure version (do notation being a great example of this, it’s really just a chain of lambdas). You can do functional style programming in a lot of languages now, but they’ll also let you mix and match other styles, which can make it easy to “cheat.” Haskell will teach you functional programming and that’s it.

          Also, since it sounds like you’re familiar with Rust, it uses a lot of ideas from Haskell. Rust enums are a clone of Haskell’s algebraic data types, patterns are almost exactly the same, traits are typeclasses right down to the fact that the compiler can derive some common ones automatically, Rust strongly encourages immutability while Haskell basically requires it, and in both languages you’re only allowed to break the rules if you start using things with the word unsafe in them. My experience learning Rust was “oh, C and Haskell had a baby named Rust, cool!” The big difference is that in Rust, you’re programming from inside a C-style computer with RAM, while in Haskell you’re programming in a mathematical void and the computer is tidily packed away in a box labeled IO.

          A fun guide for learning Haskell is here: https://learnyouahaskell.github.io/

          • ageedizzle@piefed.caOP
            link
            fedilink
            English
            arrow-up
            1
            ·
            18 hours ago

            Very interesting. Haskell definitely intrigues me. What’s the learning curve like, I hear it can be a bit tricky?

            • chaos@beehaw.org
              link
              fedilink
              arrow-up
              2
              ·
              15 hours ago

              It’s very different. You have to come at problems in a very different way because the tools at your disposal are not what you’re used to.

              The language itself is quite elegant and simple, if you strip it down to its essence it’s basically “when you see A on the left side of the equals sign, replace it with B on the right side of the equals sign” repeated until your program has either errored out or been boiled down to a single value. The type checker ensures that the replacement will be legal no matter what’s happening at runtime, and can really help with getting things lined up just right because it’s very thorough.

              The simplicity also leads to complexity, though, for a few reasons. The solution to any problem is usually generalizable, since there’s such a small surface area to the language itself and the type system allows for very abstract declarations of what a thing does, which leads to very beautiful solutions that are also so general and reusable that it can take work to figure out “okay, so this thing composes one function that is traveling recursively down the list of pairs, applying this function to the first item, and that’s composed into this other function that is pulling them apart into separate lists…” whereas if it had been written the “dumb” way it’d be more like “oh, we’re breaking these items into two lists and tweaking the first item as we go,” unnecessarily tied to the one particular scenario and totally unusable anywhere else in your code, but also more readable and concrete. There’s an entire vocabulary of functions that do abstract things that you have to learn to make sense of what’s going on sometimes.

              Related to that is monads, which are such a common pattern in Haskell that the language has special notation for them; they’re an incredibly powerful tool for putting values in a context and/or creating an environment where background details can be handled out of sight, but they’re also so generalizable that they span from the simplest monad that basically just captures “this thing might not actually exist” all the way to the IO monad which, in a way, represents the entire universe, or at least your entire computer. Learning Haskell means wrapping your mind around them, which isn’t impossible, they’re actually quite simple, basically just 2 functions that need to follow a few rules, but it takes a few examples and explainers to really get it.

              Generally I think any programmer benefits from at least trying out something like Haskell, even if you never become an expert or use it day-to-day, it’ll give you a new angle to think from and could spark thoughts you never would have had before.

        • orclev@lemmy.world
          link
          fedilink
          arrow-up
          5
          ·
          1 day ago

          For a newbie probably something like Scheme (which is just a particular flavor of LISP) although I wouldn’t call it a good language.

          Here’s the thing with purely functional languages that don’t allow in place mutation (most of them, or only under special circumstances like Haskell’s ST Monad), they force you into learning functions that typically don’t exist in other languages like foldl and force you to think about approaching problems in a different way. This will make you a better programmer even when working on other languages, but it’s very much something you have to learn and like all learning it will take time and effort.

          I’m actually tempted to say Haskell is the best option because it actually is a really good language but it’s not so much a learning curve as it is a learning grand canyon. It has an amazingly powerful type system (very similar to Rusts) and uses it very well, but it’s also very unintuitive because it’s deeply rooted in academia and uses names for things taken from set theory and mathematics (terms like endofunctor, profunctor, affine space, and of course the famous Monad). If you’re finding Rust a struggle Haskell would be 10 times worse for many of the same reasons.

          Another maybe good option that I can’t definitively recommend would be OCaml. I’ve heard really good things about it and what I’ve seen of it looked good, but I haven’t personally used it beyond maybe a little reading and a hello world type thing so I’m unsure what kind of pitfalls a newbie might run into.

          The primary reason I’d recommend Scheme is because it’s in many ways a very primitive language. Its type system is very simple and it really doesn’t have a lot going on other than being purely functional. That is also its biggest downside with its second biggest problem being a rather annoying syntax (be prepared to spend a lot of time counting parens to make sure you’re closing every pair and working in the scope you think you are).

          • ageedizzle@piefed.caOP
            link
            fedilink
            English
            arrow-up
            2
            ·
            18 hours ago

            Thanks for your write-up. Haskell sounds interesting but a bit intimidating. I’m definitely intrigued by the functional programming thing though, I think that might be my next stop. Ruby seems interesting but I’m already familiar with JavaScript, which seems a bit similar to me, so it would be nice to shake things up a bit.

  • cerement@slrpnk.net
    link
    fedilink
    arrow-up
    7
    ·
    2 days ago

    since you mentioned Rust, it can also be a matter of how you approach learning it – maybe learning a game might be more comfortable – as an example, Reddit’s r/roguelikedev links to multiple tutorials in multiple languages (with at least three Rust based options):

    • ageedizzle@piefed.caOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      18 hours ago

      Very interesting. Learning a game is definitely a good way to keep motivation up. I’m glad this exists. Thank you!