discussion icon indicating copy to clipboard operation
discussion copied to clipboard

Status of Bubble & Lantern

Open RogerLevy opened this issue 8 years ago • 8 comments
trafficstars

Last September I posted about my ANS Forth game engine with brief mention of its ancillary namespacing system which I call Idioms. Idioms are extensible gathered wordlists, with a convenient and complete declaration and switching grammar. The engine is now called Lantern and it's sort of a hybrid of 3 engines which powered The Lady and 2 unreleased games, one of which was started over 10 years ago. Thanks to idioms, the engine features an easy-to-use lexicon with a laser-like focus, without limiting the ability to provide more powerful features later on. Or at least that's the goal. I think it's going pretty well.

Instead of direct links, I'm just going to direct everyone to my profile - you can find them there.

Things were getting messy and uncertain last year, and I ended up taking a few months off from all programming due to burnout. But I got a new part time job that let me resume work. Many bugs were fixed (particularly with idioms) and the file structure was improved. The in-game "IDE" got a mini-rehaul and I started developing a GUI system. Having an in-game REPL is essential for fusing code and design, which is the direction I plan to go further in.

Bubble is pretty much stable. For Lantern, I'm on the final lap to 1.0 Beta. 1.0 is not meant to be very big. I have just a handful of features to complete and then I plan to shift gears to doing more game development within the defined boundaries (which still are pretty huge). A lot of the functionality is already provided by Bubble - it's bringing it all together that takes some planning and decision making. There will also be a handful of nice examples. (I use those to develop and test functionality.)

This is the apex of my years of research and development in Forth! The final destination. No more abandoned experiments. I'm excited to share it in its alpha phase and to enter a new chapter that should be marked by creativity and buttloads of fun. I hope to hear feedback from everyone!

RogerLevy avatar Jun 21 '17 06:06 RogerLevy

Thank you, this certainly looks interesting. I'm not much into game programming, or Windows, but this may change in the future.

I don't see much in the way of instructions in the Lantern repo. Do those from Bubble apply?

larsbrinkhoff avatar Jun 21 '17 06:06 larsbrinkhoff

Roger, do you have docs on "idioms"? By the way, abandoned experiments are a good thing: failure is a necessary result of research (the alternatives are "doing the obvious", or "pure luck").

TG9541 avatar Jun 21 '17 07:06 TG9541

here are some docs about the namespacing system :: https://github.com/RogerLevy/lantern/blob/master/bu/lib/idiom.f

xieyuheng avatar Jun 21 '17 08:06 xieyuheng

@RogerLevy since the namespace-system can be used as an OO-system, it might be helpful to explain it by comparing it with classical OO-system [maybe smalltalk ?], concept by concept, advantage by advantage.

xieyuheng avatar Jun 21 '17 08:06 xieyuheng

I updated the dox at the top of idiom.f.

I can't compare it to anything except that it doesn't function like a conventional namespace system. You are given a lot of freedom. It's also not meant to make everything totally drop-in, like in other languages. IMO that's an anti-pattern, you should not make EVERYTHING modular, which works especially poorly in Forth. Some idioms are like pieces of a puzzle, others are meant to be "wrapped" by another idiom. You could make a "safe" idiom that could be imported anywhere, by using hyphens. Which isn't ideal but fine, I expect people will probably do that until the "simple style" I've cultivated is analyzed and labelled. At least with stuff meant to be shared across projects. I think of idioms more like buildings rather than objects - you work IN them, if that makes sense.

I do use it like a classical OO system in one place (with very limited data member inheritance). It's essential for game object (player, enemies, bullets) programming - without it you can't make larger games without getting very verbose. But you are meant to compartmentalize by topic not necessarily data. Only sometimes do those overlap. If you treat them like classes you will get no benefit, it will probably make things harder. Just use an OOF system then.

Advantages:

  • Helps avoid name collisions by allowing private words. Don't overuse this feature though, it gets cumbersome if you need to test private words too much. I use it mostly for extremely simple (1 or 2-letter) words, throwaways, or stuff that will never ever ever need to be tested or used outside the idiom's context.
  • Helps avoid name collisions another way; you can "peel back" the search order to define a component that is unaware of the larger application at any point, more conveniently than with the stock ANS Forth facilities
  • You can package all the words used by a component together with it. Eases testing.
  • Is conducive to programming in "phases" that stack on top of each other
  • Context is flat rather than bracketed; you don't need a closing bracket (or opening for that matter) and idioms can span multiple files. You don't need to give each file its own idiom either. Very permissive and flexible - therefore it takes a little practice and thought about how you should partition.

There's more --- they gave rise to "patterns", some of which are mentioned in the dox, the rest you'll have to discover through looking at the rest of the codebase, for the time being... there's enough I could write a book on it :/

RogerLevy avatar Jun 21 '17 12:06 RogerLevy

@larsbrinkhoff Yep, install instructions for Lantern are the same as Bubble. The documentation will take the form of examples at this stage - I'm prioritizing game development over documentation until sometime later this year, which will likely be near the point it's taken out of beta and made an official release.

RogerLevy avatar Jun 21 '17 13:06 RogerLevy

Roger, your enthusiasm is infectious. I'll be spending more time with this in a week or so, and thanks for the additional information on idioms ...

Rob Sciuk

paraplegic avatar Jun 21 '17 14:06 paraplegic

I've completed all the planned features for the 0.9 alpha milestone and decided to learn another game engine to make games in for the time being. So the project is now on indefinite hiatus.

Once the remaining problems regarding namespacing, object management, portability, and dependence on a commercial Forth are resolved I'm sure it could one day be a very strong engine. I am done with working on these technical problems for now though.

When I resume work on it I will move it to another Forth (for now GForth is at the top) and use either Forth Meets Smalltalk or mini-oof2.fs as the basis, to increase productivity. Programming by topic (idiom) is interesting and fun but it is also a hard and time-consuming and highly experimental mental exercise with uncertain outcome. My life has become more diverse and my brain is finite and I have other things I want to accomplish first.

RogerLevy avatar Sep 05 '17 07:09 RogerLevy