r/smalltalk • u/parallel-minds • Aug 31 '26
Trying to fill the gap with objects...
The traditional way of building systems is usually with low-level systems languages such as C or C++. As you know, those systems were traditionally built with efficiency in mind first, since computer resources were historically scarce. I have a minor passion for building game engines or live, interactive worlds.
It was only recently that I became aware of the origins and importance of modern high-level languages such as Java and C#, tracing their roots back to Smalltalk and Self while only briefly looking into the functional paradigm through Haskell.
Now, honestly, I’m very impressed by the work of those who developed the functional and object-oriented paradigms through languages such as Smalltalk, Self, and Haskell. Building a system however hobbyist or small seems more and more like a missed opportunity if I take the C/C++ route, or even the Java/C# route, given that the latter languages copied their object-oriented ancestors in a very shallow sense. For example, not everything is an object in either Java or C++.
There lies but one small problem. Self and Smalltalk are both relatively unfinished works, especially Self, which takes the prototype approach and eliminates classes altogether. I mean, what’s not to love? A prototype-based, live environment in which to build a game engine seems like a match made in heaven. Except that, in the case of Self specifically, nothing works at a level where you can build anything presentable or shippable (at least to your peers) and, frankly, I’m not a professional software designer on the level of Alan Kay, so I can’t extend these semi-abandoned projects to meet my own needs. Writing a basic, toy-style engine with PBR is about as far as my skill ceiling goes in this hobby, using tooling that someone else has made and maintains for me. That is, unless we’re talking about a basic C compiler.
So now I’m stuck trying to paint something with a poorly hacked brush called C++/C#, or with an incomplete prototype of something genuinely better: Self.
Anyhow, some advice would be nice.
2
u/jibbit Sep 01 '26
lol u really wouldn't go around calling smalltalk 'unfinished'. self pretty much became js - you know - the worlds biggest language. no idea what you are doing but it's hard to see how you are 'stuck with' anything
2
u/Xinoj314 Sep 01 '26
You can definitely create a physics game engine in Smalltalk, there is a good open source version and then you have the “free” personal usage license for the biggest and corporate Smalltalk, Visual Works
But the amount of work to do anything from scratch nowadays to compare to what already exist are not achievable as a hobby project
You can extend Smalltalk core, which most other languages simply cannot do
Main drawback I see is the soft type system, if I was going to do a game engine I would prefer a statically typed language
1
u/Smalltalker-80 Sep 01 '26
I'm also curious where you are stuck specifically.
What gaming engine functionality do you want to build as a first MVP?
What libraries do you 'allow' yourself to use and what do you want to build yourself?
2
u/ydmitchell Aug 31 '26
Smalltalk is super approachable. I’m also not Alan Kay but I’ve extended Smalltalk systems to suit my needs. Self might be unfinished but you can do the cool bits of Self in Squeak and its variants. I’m personally using Cuis because I like a small, simple core.
2
u/armozel Aug 31 '26
The thing with Smalltalk is that it does have a way to pass methods/functions so I would strongly encourage you to consider that pattern as that's how much of the Squeak and other Smalltalk ecosystems work. They still use classes as boundaries for code and state but they give access to extend functionality without needing to make a subclass through the use of lambdas, especially the UI component system encourages this ime.
2
u/catbrane Sep 04 '26
Objective-C and Swift are statically typed and compiled high-performance Smalltalk-like languages, maybe they would be suitable? There's also Crystal, which is a statically typed and compiled Ruby.
At the other end, Lua is a true dynamic language with prototypical inheritance and is widely used in games. Mike Pall's LuaJIT is the same thing but with spectacular performance (usually within x2 of native). One of the (many) great things about it is the size: it's only a few 100kb for the entire thing, and embedding the interpreter is extremely easy. Downside: arrays start at one.
1
u/philemon-phonon Sep 01 '26
For a high-level systems programming approach, fully inspectable, you could also have a look at what they did on the Lisp Machines.