Nothing Found :(
Where Would You Like To Goto, Today? Blog
26th April 2024
The quest to Goto continues...

-=-=-

Michael Fernie


Maybe go the other way. Change JSE not to use GOTO

*throws toys out of pram*
NOooooo!!!

JSE is a form of Basic.
If the user can't type

10 Print "Hello World"
20 Goto 10


Then, frankly, what's the point of it?

I could, of course, fix up JSE to "avoid" Gotos, but I wouldn't want to remove them entirely. They're useful. Gosubs even moreso.
... Could probably do with adding functions, but that's for another time.

Right now, I've got my stick and my rock, and I'm going to keep hitting them together until I make fire.
Whether that fire will be a lovely peaceful campfire, or an explosive flaming fireball that engulfs all my work and causes death and destruction around the world, hasn't yet been decided.

Javascript'y


Over in Javascript, it just isn't looking all that hopeful. As much as I've tried to figure out a way to goto and gosub, it's been bafflingly difficult, especially since I've written a language inside Javascript that DOES handle them perfectly well.
Grrr, logic!!!

I think my dreams were trying to fathom it out, last night, and there's some sort of oddball idea in my head that I "think" might work..
Wrap chunks into functions, and try to retain the constant flow, but whenever there's a goto, split the function into two, and give each half a new unique identifier. If there's a gosub I'd need to split into three.

Honestly... "Spaghetti Code"... this is what they mean.
A language without goto, trying to be crafted into one that does, and leaving a trail of breadcrumbs all over the bloomin' place, because for some bizarre reason, Gotos have been shunned by society.

If we've learned anything over the course of humanity, it's that anything can become corrupt and warped and frankly disastrous if you let it.
I'd much rather give people a choice, than strip away that choice because of some bad examples.

C'y




Over in C++ World, CoPilot and Poe both agree that a possible methodology "should" work, as long as I use a GCC compiler to compile it.
ChatGPT and Claude, however, both agree that the exact same methodology "definitely" won't work, because C++ doesn't work with gotos and labels like that.

ChatGPT did, however, offer me a "fixed" version of my example code, along with a disclaimer that gotos are evil and should be burned at the stake..
Don't worry, ChatGPT.. There'll be fire!!

I think the plan, right now, is to leave JSE as-is in the browser, unless I can solve the goto issue, and then have all the alternative Transpiled versions for the Blitz3D/BlitzMax/C++/(etc?) targets. With a specific note that any C++ compiles must be done with a GCC "goto compatible" compiler.


"Cartoon @Derek and the pigeons", by #ArtFlow.ai
Views 5, Upvotes 1  
Daily Blog , Jse
Site credits : PHP script, Blog posts, Games, Music, Pixelart, Poems and More : Jayenkai
(c) Jayenkai 2023 and onwards, RSS feed

Blog - Where Would You Like To Goto, Today? - AGameAWeek