6 ms·
As much as I love Rust I sometimes wonder if I'd be more productive in a simpler language. If I wrote it every day I'm not sure that would be true, but as a hob
by nu11ptr 2y ago
As much as I love Rust I sometimes wonder if I'd be more productive in a simpler language. If I wrote it every day I'm not sure that would be true, but as a hobbyist coming back to Rust sometimes takes me a bit to get back in the zone. Also, still not a fan of async, as it is woefully incomplete and fairly complicated in some use cases. That said, I just can't go back to Go with nil pointers and lack of decent enums/ADTs/pattern matching either. I long for the "in between" language, but with an amazing 3rd party ecosystem as both Rust/Go have.
NOTE: I'm not a game dev
- BoorishBears 2y agoIsn't that just Swift/Kotlin?
- nu11ptr 2y agoThe problem with languages is they don't compose. Iow, one missing feature needed automatically invalidates the language entirely. Swift is targeted at Apple platforms and cross platform is an after thought. Kotlin targets JVM and while it is cool in concept, I hate it as a user (and Kotlin native isn't near as mature). If were considering something else at this stage I'd probably put my time into F#, but even it has its cons. NOTE: By "compose" I mean that if I want feature A, B and C from lang X (has A and B), Y (has B and C) and Z (has A and C), but there is no way to get A, B and C in one language without creating a brand new one. I cannot mix and match features from different languages.
- Scramblejams 2y agoAnd if we're still talking about gamedev, F# would probably make the GC too sad. (When are we getting a low latency collector in the CLR? But I digress...)
- nu11ptr 2y agoYeah I'm not a game dev and don't write anything with low latency requirements. Almost all my code is in the "thoughput" camp.
- BoorishBears 2y agoThey don't compose what? Is this one of those 'monad is an endofunctor' deals? (me not knowing might be the ignorant bliss that allows me to just do productive things in them regardless) Edit: I understand from the updated comment I've long accepted that no one language can offer all of the language features I'd want, but I also question if I'd even want that language if I got it
- akavi 2y agoIt's any of: Rust + (garbage collector) Swift + (cross platform support) Kotlin + (proper pattern matching) Unfortunately, none quite hit that central sweet spot, IMO
- tkz1312 2y agoRoc is looking very promising IMO
- melodyogonna 2y agoMojo soon
- valcron1000 2y agoWell, Kotlin + (proper pattern matching) = Scala
- MrBuddyCasino 2y agoAnd Zig maybe?
- Scramblejams 2y agoI've been hoping to see more languages that compile to Go, it might be the most practical way to arrive at what you want. For example, see Borgo: https://news.ycombinator.com/item?id=36847594 https://news.ycombinator.com/item?id=36847594
- nu11ptr 2y agoI keep toying with the idea of creating one. :-) Borgo looks neat - hadn't seen it before.
- Scramblejams 2y agoGo (!) for it! I'll try it! :-D If you do, I'd ask you to give some thought to FFI efficiency. I've been wondering if there could be a good way in a transpiled language for the type system to validate at compile time that any pointers passed to C are pinned, so you can safely run the FFI calls with cgocheck=0 which eliminates quite a bit of overhead.
- ReleaseCandidat 2y ago> I've been hoping to see more languages that compile to Go One could also use Go-Assembler as a cross-platform assembly target: https://go.dev/doc/asm https://go.dev/doc/asm
- brabel 2y agoMaybe people will make fun of me, but I've been very happy with Kotlin and Dart. Null-safe, good ergonomics, very fast. I've tried Rust, sometimes play with C, D, Deno/TS, Nim, Java (actually I still write lots of it) and even some more cutting-edge stuff, like Unison. While they're cool, what I want is a language with really good tooling that gets out of my way without letting me write patently dumb code (like Java lets me use any object without checking for null, when it can be null but the language just doesn't give a shit to help me). I use Dart when I want to compile to binary executable or use Flutter, and Kotlin for stuff I think the JVM has more to offer, like a server. The two languages are just a pleasure to use, pretty similar but having completely different ecosystems (which is great, you can use the best one for the job!).
- nu11ptr 2y agoI'm glad you found tools/languages that work for you. Kotlin felt a little too much like Java to me. If I stuck with a JVM lang. I'd probably go back to Scala 3, but I just don't like the JVM as a user (just sucks too many resources).
- ImHereToVote 2y agoFlutter sounds so awesome but really want something like OpenGL for it.
- YawningAngel 2y agoI like Kotlin but I find the fact that it lacks a good way to detect and handle possible errors very frustrating. If some function can fail on sane-looking input I'd like to know about it
- nmfisher 2y agoI wrote a Flutter package[0] that wraps the Filament 3D renderer, which I used to make a mini game for a Flutter game competition: https://devpost.com/software/escape-from-heat-island https://devpost.com/software/escape-from-heat-island (Judging is still ongoing and votes would really be appreciated! It would help me to get more resources to work on the underlying package). This was my first ever “game” (tech demo, really), and I’m not a game dev, so take this with a grain of salt - but I do think there’s a lot of potential for Flutter/Dart as a game framework. Hot reload makes iterating on game logic very fast, you obviously get the UI toolkit and cross-platform support straight out of the box, and the language itself is (relatively) concise, so it lends itself well to gameplay programming. When you need to get your hands dirty at a lower level, you just drop down to C++ (or whatever engine you can expose via FFI). I think Google believe that Flutter can nab market share from Unity in casual 2D games (hence their official sponsored competition), but I think it has even more potential than that. In fact, I’ve seen at least two game companies (Supercell and another whose name I’ve forgotten) hiring for people to work on embedding the Flutter engine in various platform games. [0] https://github.com/nmfisher/flutter_filament.git https://github.com/nmfisher/flutter_filament.git
- andrepd 2y agoRust is in a separate class of go and swift and kotlin and etc. The class it competes on is pretty C, C++, and itself. Yes it's easier to write trivial code in python than Rust. Yes it's harder to manage memory manually than it is to let a gc handle it. I don't see the point. Rust is a systems programming language. It's hard to write a server in it than it is to hack something in node, but it will also be faster and more reliable. Conversely, it's easier than writing it in C++ or C, while still being more reliable. That's the whole value proposition.
- astrange 2y agoSwift has a systems programming subset, and an even smaller embedded programming subset. Of course "smaller" is significant here; it has less features and you might not like using it anymore.
- pjmlp 2y agoFor Apple, Swift is their Rust, regardless of the world outside Apple's ecosystem thinks about it. It is clearly stated on Swift's documentation, they already hold a couple of talks at C++ conferences about code migration, and is one of the reasons why nowadays they mostly focus on LLVM contributions instead of clang.
- margorczynski 2y ago> I just can't go back to Go with nil pointers and lack of decent enums/ADTs/pattern matching either. Go is simply a badly designed language where the idea of "simplicity" has been maligned and proven bad ideas likes nil/null, exceptions and such have been introduced in a seemingly modern language. One would think that decades of Java, Javascript, etc. code blowing up because of this issues would teach someone something but seems that is not always the case.
- nahnahno 2y agoAnd yet it is incredibly productive. The poster that contrasted engineers with artists got it right I think. Go is an engineer’s language.
- grumpyprole 2y ago> Go is an engineer’s language. No, Ada/Spark is an example of a good engineers language. Go is a mediocre effort at best. Rob Pikes defence is that it was designed for junior Googlers who "aren't capable of understanding a brilliant language". Yes that's a real quote.
- Exuma 2y agoWhat’s a brilliant language in this context
- grumpyprole 2y agoYou'd have to ask Rob Pike. My own example of a brilliant language is Haskell, but it's not without problems.
- pjmlp 2y agoApparently anything that offers a type system beyond Go's.
- melodyogonna 2y ago[dead]
- sgt 2y agoI mean.. Java is there. Java 23 is really interesting.
- nu11ptr 2y agoWhen is Java getting value types? It has been talked about forever now.
- sgt 2y agoGood question. I think it must be this one: https://openjdk.org/jeps/401 https://openjdk.org/jeps/401 I can't see it in the feature list of JDK 22 or even 23. Maybe it'll come in JDK 24?
- msgilligan 2y agoJava 23 is not final and I'm hoping this JEP makes it into 23: https://openjdk.org/jeps/401 https://openjdk.org/jeps/401 I don't follow the JEP process closely enough to know if it will be proposed for 23 or approved. But I think it's coming soon.
- pjmlp 2y agoAnd it will still take time to come, the whole engineering problem is how to introduce value types, make classes that are clearly value types like Optional, turn into value types, while at the same time not breaking the endless amount of JAR files in production, when upgrading to a JVM with value types support enabled. They would get it sooner by breaking the ecosystem, and as Python 3, Java 9, .NET Core have shown, not everyone would be racing to adopt the new shiny thingy.
- fire_lake 2y agoOCaml could be that language. I’m not convinced that ecosystem is so important for game dev. Once you have a simple graphics library, bindings to BulletPhyiscs etc most of the code is custom simulation code with no integrations needed.
- myaccountonhn 2y agoI can echo OCaml. It is probably the most underrated language imo. It has great compilation times, macros, type inference, good tooling. With few exceptions, the library ecosystem doesn’t suffer from the same overengineering issues as Haskell and types are kept relatively simple. It has simple runtime characteristics making it easy to optimize performance when needed, although it tends to be very fast in general.
- brooke2k 2y agolast I used OCaml, the standard library situation was abysmal (compared to say Haskell's), and you had to go searching for third-party "batteries included" crates to cover simple stuff. Has that gotten any better the last few years?
- lawn 2y agoIt doesn't occupy the same space, but the simplicity of Gleam has been very enjoyable to me. It's still quite a young language though, but worth keeping an eye on.
- notnullorvoid 2y agoAs much as I dislike many of the legacy issues with JavaScript I find TypeScript to be the best language to iterate with. If Rust had GC without need for wrappers like RC though I think that would be my preferred iteration language. I mostly try to write my TS in a manner that would translate to Rust, but that's hard to do sometimes when it comes to memory management.
- 110bpm 2y agoFor me, the closest language currently is F#. The open-source ecosystem is not as massive as Go's or the JVM's, but it's not niche either. F# runs on .NET and works with all .NET packages (C#, F#, ...). If the .NET ecosystem can work out for you, I recommend taking a closer look at F#. F# allows for simple code, which is "functional" by default, but you're still free to write imperative, "side-effectful" code, too. I find this pragmatic approach works extremely well in practice. Most of my code ends up in a functional style. However, once projects grow more complex, I might need to place a mutable counter or a logging call in an otherwise pure function. Sometimes, I run into cases where the most straightforward and easy to reason about solution is imperative. If I were confined to what is often described as a "pure functional" approach, I'd have to refactor, so that these side-effects would be fully represented in the function signature. F# ticks the enums/ADTs/pattern box but also has its own interesting features like computation expressions [0]. I would describe them as a language extension mechanism that provides a common grammar (let!, do!, ...) that extension writers can target. Because of this, the language doesn't have await, async or any other operators for working with async (like C# or TS). There's an async {} (and task {}) computation expression which is implemented using open library methods. But nothing is preventing you from rolling your own, or extending the language with other computation expressions. In practice, async code looks like this: let fetchAndDownload url = async { let! data = downloadData url // similar to C#: var data = await downloadData(url); let processedData = processData data return processedData } I often use taskResult{}/asyncResult{}[1] which combine the above with unwrapping Result<>(Ok or Error). Metaprogramming is somewhat limited in comparison to Scala or Haskell; but still possible using various mechanisms. I find that this isn't a big issue in my work. IDE-wise, JetBrains Rider is a breeze to work with and it has native F# support. There is also Visual Studio and VS Code with Ionide, which are better in some areas. You can run F# in Jypiter via .NET Interactive Notebooks (now called "Polyglot Notebooks" [2]). I haven't seen this mentioned often, but this is very practical. I have a combination of Notebooks for one-off data tasks which I run from VS Code. These notebooks can even reuse code from my regular F# projects' code base. Over the past years, this has almost eliminated my usage of Python notebooks except for ML work. [0]: https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/computation-expressions https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref... [1]: https://github.com/demystifyfp/FsToolkit.ErrorHandling?tab=readme-ov-file#a-motivating-example https://github.com/demystifyfp/FsToolkit.ErrorHandling?tab=r... [2]: https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.dotnet-interactive-vscode https://marketplace.visualstudio.com/items?itemName=ms-dotne...
- jejdirhrjeij 2y agoYeah I long for a language that has rust enums and pattern matching but none of the async or borrow checker. Maybe I should just unsafe rust and see how I go....
- manx 2y agoHave a look at Scala.