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

  • smlckz@piefed.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    5 months 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.

    • oatscoop@midwest.social
      link
      fedilink
      arrow-up
      0
      ·
      5 months ago

      And the best way to learn forth is by implementing one for yourself.

      … I wrote a FORTH interpreter in TI-BASIC decades ago. I thought I was weird.

  • Kacarott@aussie.zone
    link
    fedilink
    arrow-up
    0
    ·
    5 months ago

    The most fun languages to learn that I have learned so far, are Haskell, Factor, Prolog and Agda. Each are quite different from mainstream programming and each other, and it is really satisfying when concepts “click”

    • ageedizzle@piefed.caOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      5 months ago

      I was looking for some ‘Big Daddy-O’ super-fun rando programming language that some guy wrote in C over the weekend in his garage, but Python should work too.

    • ageedizzle@piefed.caOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      5 months 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
        0
        ·
        5 months 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
          0
          ·
          5 months 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
            0
            ·
            5 months 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
              0
              ·
              5 months 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
            0
            ·
            5 months 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.

      • ageedizzle@piefed.caOP
        link
        fedilink
        English
        arrow-up
        0
        ·
        5 months 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

    • ☂️-@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      5 months 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
      0
      ·
      5 months ago

      How does C compare to Rust? I’ve heard you can learn the syntax in a weekend, but you spend years trying to master it because of all the memory leaks and such that it leads to. Would you say that’s accurate?

      • orclev@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        5 months ago

        So C is basically assembly with a bunch of syntactic sugar on top. It manages a lot of the book keeping and boilerplate, but at the end of the day there’s not a ton of difference between them in terms of the abstractions it provides. If you know assembly learning C is a piece of cake. If you don’t you’re probably going to take a while to really wrap your head around pointers and the myriad ways C can use them for great and terrible things. Beyond pointers (and race conditions if you’re crazy enough to do multithreading in C) the rest of C is super easy because there really isn’t much else there.

        Rust on the other hand is a much higher level language more comparable to something like Java, C++, or Python. It gives you a lot of tools to solve complicated problems but unlike Java and Python and like C++ it still gives you the option of working at a low level when you need to. The big advantage it has over C++ is that it learned from the many mistakes C++ made over the years, and the borrow checker really is a unique and powerful solution to both memory management but also crucially concurrency problems.

        • ageedizzle@piefed.caOP
          link
          fedilink
          English
          arrow-up
          0
          ·
          5 months ago

          Interesting. I always assumed that Rust would be more similar to C since they are now using Rust in the linux kernel

          • orclev@lemmy.world
            link
            fedilink
            arrow-up
            0
            ·
            5 months ago

            No, for a good modern C alternative I’d look at Zig. The main reason C is used for the Linux kernel is because Linus hates C++ for a variety of reasons. For what it’s worth I agree with him. Most other OS kernels are written in C++. Linus allowed Rust in because it demonstrated that it could provide the same power as C++ without all of C++'s problems (mostly that over the years it became a kitchen sink language, anything that anyone ever thought might be a good idea got rolled in even when it was incompatible with some other feature already in the language).

            • ageedizzle@piefed.caOP
              link
              fedilink
              English
              arrow-up
              0
              ·
              5 months ago

              Thanks for the suggestion. How does Zig compare to C safety wise? One of my main reasons for going for Rust was because I was looking for something like C but safer

              • orclev@lemmy.world
                link
                fedilink
                arrow-up
                0
                ·
                5 months ago

                It’s a bit safer and a lot more convenient to use, but still lets you do dangerous things with pointers. At its core it’s still fundamentally the same as C just with a bunch of helpful tools and features to make doing all the stuff you do in C easier and more convenient.

                Really the biggest thing it does significantly better than C is its macro system. C macros are “dumb” in that the C pre-processor does a simple find and replace on the source files without doing any kind of processing on the underlying C code so you can E.G. write C macros that spit out mangled illegal C code when you run them. Likewise a C #include is literally the same thing as copy and pasting the contents of the included file before it gets fed into the compiler.

                Zig on the other hand has a smart macro system that’s actually aware of the zig code and works in concert with it at compile time.

      • otacon239@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        5 months ago

        Python is like your automatic transmission. It handles a lot of work on the backend to make life easier, but the trade off is performance and control.

        In C/C++, you’re reaching into the gearbox and moving it by hand. It doesn’t clean up anything for you and doesn’t prevent you from making dumb mistakes. In exchange, it can be wildly faster than Python.

        In Assembly/Binary, you’re crafting the gears before you can even start the car.

      • ImgurRefugee114@reddthat.com
        link
        fedilink
        arrow-up
        0
        ·
        5 months ago

        Somewhat. The issue isn’t memory leaks themselves so much as learning project architecture, patterns, and generally how to do things without shooting yourself in the foot.

        Rust has plenty of gotchas and unintuitive elements, so they’re not too different in that sense. Though Rust is more likely to point out when you’ve done something wrong, where as C will exercise your debugging skills.

        Modern C++ is also an option, and surprisingly easy to use. The only catch is that the errors can be very difficult to parse and it’s hard to find modern best-practice materials to learn from since most of industry is quite far behind compared to where the language is.

        One benefit Rust has is that it’s quite new and niche, so the materials tend to be of fresh, without much legacy mindset, and of a relatively high quality. Tbh I’m not sure how Rust is for newbies, but it may be worth a shot. At the very least, the community is passionate and the errors will be readable…

        • ageedizzle@piefed.caOP
          link
          fedilink
          English
          arrow-up
          0
          ·
          5 months ago

          generally how to do things without shooting yourself in the foot

          In programming, as in life, this is key.

          To your point, I have found the error messages and the documentation for Rust to be super helpful and easy to read. As a newbie it is straightforward enough, but it’s really an endurance game, because I think unlike other languages you need to cross a critical threshold before you can really understand the language well enough to use it even for simple tasks

      • CameronDev@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        5 months ago

        Rust is close to C++, in that you get a lot of high level constructs to help you. C is very low level, and you can learn the syntax in a weekend, but you’ll also have to learn memory management and implement advanced structures (linked lists, etc) yourself.

        Memory management isn’t too hard, it’s mostly remembering who created what, who reads and writes to it, and who is responsible for cleaning up. With some additional comments as you go it’s not too hard. Also, depending on what your doing, leaks may be acceptable. A short lived program can leak all it likes, and the OS will clean up for you ibthe end :D

  • Caveman@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    5 months 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.

  • DaPorkchop_ [any]@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    5 months 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

    • ageedizzle@piefed.caOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      5 months ago

      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

      What is your honest opinion about Rust? I’m curious

      • DaPorkchop_ [any]@lemmy.ml
        link
        fedilink
        arrow-up
        0
        ·
        5 months ago

        Rust has a lot of cool ideas (I love the borrow checker), but in its current state I don’t think it can replace C++ for the things I’d be interested in using it for. 99% of the time when I reach for a natively compiled language it’s because I need to do some performance-critical loop I can’t reasonably implement in the language my business logic is written in (normally Java), and I end up in a situation where most of Rust’s advantages (and C++'s footguns) aren’t really relevant (lifetimes don’t matter if I’m just writing some SIMD code which reads/writes into externally allocated memory segments). So for my purposes, Rust is mostly just a worse version of C++ in that it’s missing a bunch of features I want (my main gripes already listed above) and has a bunch of cool features that I don’t care about.

        If I were writing an entire program from scratch I’d probably opt for Rust over C++, at least for the bulk of the business logic, but I don’t think Rust has quite achieved its ideal of “zero-cost abstraction” for many performance-critical use cases, and certainly not most of the ones I actually have.

    • ageedizzle@piefed.caOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      5 months ago

      All these comments on LISP here are just making me realize I don’t really know what LISP is. I will have to look into it. Thanks for piquing my interest

  • tyler@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    5 months ago

    I see a lot of people recommending things that a beginner definitely isn’t going to find fun. It’s not fun to bang your head against problems before you even understand what is going on. If that sounds like you then you do not want to be touching anything like Rust, C, C++, etc. Some people are recommending Python. I strongly recommend against that. Yeah it’s a simple language, but it breaks all conventions that other languages have set up. Whitespace, tooling, comprehensions. They’re all different. You’ll struggle with the terrible tooling, the whitespace syntax isn’t used in any other popular languages, and the stuff that is in other languages is implemented completely differently.

    I like Ruby for fun. It’s an incredibly approachable language, it’s extremely fun. The tooling is dead simple and works on every system out of the box. Of course everyone else in here is gonna recommend other different stuff, but I can tell you that I have developed professionally with both Ruby and Python for over a decade and the people suggesting Python have most likely not programmed with many other languages.

    I’ll give a second suggestion. I recently started learning Unity and it was a blast. It brought back that joy of programming for me. Of course, most of it isn’t programming, but that might help things in your case. So maybe if you’re looking for something that isn’t so … ‘backend’ then that might be what you want, a video game engine that can get you started easily.

    Some others suggested esoteric or less used languages like Lisp or Forth, and I can’t give any recommendations about those. Maybe you’ll have fun with those, maybe you won’t.

    Finally, one last thing, you can compare a lot of languages to see what ‘equivalents’ would be with this tool. https://evmorov.github.io/lang-compare/ruby-python/ There’s also https://codethesaur.us/, but it covers different bits and doesn’t seem to have much for Ruby.

      • tyler@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        5 months ago

        Yeah, you’re just giving a lot of recommendations about people’s favorite language rather than the most fun. I actually didn’t recommend my favorite language (which is Kotlin) because I didn’t want to do exactly what others are doing.

        Fun languages don’t necessarily translate to ones you want to use in production. Like Ruby is great for scripting and command line tools, but I wouldn’t use it in any enterprise backend or frontend system.

  • nate3d@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    5 months ago

    Python is one of the more forgiving and extremely versatile.

    I highly recommend checking out the game “The Farmer Was Replaced” on Steam as it might be the best way to introduce yourself to programming concepts outside of a classroom. (Not affiliated, just love the game XD)

    Then in no particular order:

    • Rust (and understand C++ and all interops)
    • Typescript
    • Bash
    • DotNet (Java that works)

    And as always - learning the anti patterns is more important than learning the patterns.

    • ageedizzle@piefed.caOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      5 months ago

      Hey thanks for the game recommendation. It’s always nice to have some leisurely activity that is fun to do but you can feel productive doing anyway. Thanks for the language list too.

      This might be a basic question but what do you mean exactly about ‘learning the anti-patterns’? Can you expand on that?

        • ageedizzle@piefed.caOP
          link
          fedilink
          English
          arrow-up
          0
          ·
          5 months ago

          Interesting! This feels like it’s going to be something that, once you understand it, you can’t believe you ever programmed without it. Thanks!

          • orclev@lemmy.world
            link
            fedilink
            arrow-up
            0
            ·
            5 months ago

            See also the closely related concept of code smells. These are things that aren’t necessarily wrong like anti-patterns are because in certain niche cases or in limited amounts they’re fine, but they’re often an indicator that you’re doing something wrong in your code. As a quick example I looked up some code smells in JS and a couple of the examples were using == instead of === and having deeply nested/indented code (E.G. have if blocks inside of if blocks inside of if blocks inside of a for loop).

  • KaRunChiy@fedia.io
    link
    fedilink
    arrow-up
    0
    ·
    5 months ago

    I have had the most fun with Rust, but that’s probably because I’m a masochist.

    To me it just rolls off the keyboard very well, I don’t know how to really describe it.

  • Nate Cox@programming.dev
    cake
    link
    fedilink
    English
    arrow-up
    0
    ·
    5 months 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.

        • Gumus@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          0
          ·
          5 months ago

          I find F# more approachable than Haskell, while being more modern than Scheme. I don’t think F# would be great for production, but it’s good as a learning tool.

        • chaos@beehaw.org
          link
          fedilink
          arrow-up
          0
          ·
          5 months 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
            0
            ·
            5 months 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
              0
              ·
              5 months 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.

        • Alavi@programming.dev
          link
          fedilink
          arrow-up
          0
          ·
          5 months 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).

        • orclev@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          5 months 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
            0
            ·
            5 months 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.

      • Nate Cox@programming.dev
        cake
        link
        fedilink
        English
        arrow-up
        0
        ·
        5 months 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.