Why am I wasting time on EndBASIC?
jmmv.dev
jmmv.dev
I, too, recently implemented BASIC. It was something to do while bored. I was motivated by a desire to play the old star trek game, which it now does. It's called TrekBasic, but the github project it still private, as it's just a fun hack.
It is not as cool as yours, as I wrote it in python. It does have better features for developers than most BASICs from long ago:
Code breakpoints
Data write breakpoints
Single stepping
Execution timing
Execution tracing
Code coverage reports
Reformatting
Renumbering
I think my next step will be to move it to LLVM, just for the fun of learning about LLVM.Later ended up porting it to Pascal and adding graphics, in an attempt to learn the language.
Why am I wasting time on Pascal?
I've been spending a little time with ActiveOberon, which might look familiar to a Pascal user. It's an interesting language and environment. Reminds me of Smalltalk the way the platform works (or Pharo for a modern Smalltalk environment), except you absolutely can create more "native" binaries for your environment with it.
ActiveOberon might be one of the first places async/.await style concurrency was implemented. It definitely predates Rust by a bit.
The Fox compiler is an interesting beast too! They're still working on the language. The tip of their SVN tree has enhancements over the language report that was published in 2019 http://cas.inf.ethz.ch/news/2
Now there's ternary conditionals, functors (per C++, not Category Theory) etc.
Last update to the repo was 11 days ago. It's very much alive it seems :-)
But it's probably beyond my capabilities.
I don't want to write a parser. Although I'm aware of bison etc. I just want to get the intermediate representation into a language I can run, so as to leverage the front end compilers.
I'm honestly surprised to see this bubbling up to the front page after it was originally shared five days ago and failed to gain traction then. But anyway, thanks everyone for stopping by. It was a good surprise.
Coincidentally, I have just pushed a new 0.5 release and a follow-up blog post that might clarify some of the questions I've heard so far: https://jmmv.dev/2021/01/endbasic-0.5.html (although briefly; I'll elaborate more on answers in future posts).
And, well, feel free to AMA!
I also love to dabble in old, long-dead technologies and feel no need to justify it to anybody. I tinker with old 8 and 16 bit Commodore machines writing code and building hardware and it gives me such a thrill because "young me" would have killed to do this stuff.
We shouldn't cast shade on any language like that ( except JavaScript, which deserves all the shade).
The right programming language is the one that lets you express yourself clearly and accurately, and solves your problem with a reasonable tradeoff between implementation overhead and execution costs. That's going to vary based on the problem space and the developer's background. Should he spend 40 hours learning the latest meme language and cobbling together an amateur-night solution rather than 20 minutes actually making something that works with tools that fit the job properly?
Yeah, if the only BASIC you ever used was the pack-in one on the Commodore 64, you're probably fighting the language as much as you are solving the problem. But a modern BASIC, with a rich library, can be a perfectly valid tool choice. In some ways, a traditional and restrictive syntax can be a boon: you're strongly nudged to work within the limitations rather than wandering down trendy architectural rabbit holes.
Yeah but thats not the reason why BASIC is around is it? Its around simply as legacy or because MS insists on including it with Excel which makes it a path of least resistance choice. Lets not get too high and mighty about BASIC or VB.NET like stuff. They are bad tools, so are most other tools we use. We just make it work not because its possible, but because nobody wants to go through the requisition forms.
Edit: This comment is brought to you by my painful existence with MATLAB
Whatever gets the job done without wasting time.
Completely agreed. My point isn't that these tools can get the job done, but that I see too many people praising them because they can get the job done. There is a difference between done and useful. I can throw together a market model in excel quite fast and easily, its "done". It might even be useful in your case, but please don't give high praise to it because no real world task has ever ended with that task. Everything you will create, especially software will be reused. That's the whole point and power of software. These tools make it incredibly hard to reuse anything. I think we should have higher standards for our tools, especially when whole companies are being built on it (don't think google here, think portfolio management companies and Excel).
Edit: I would like to include an example of a spoon. I can bash in a small nail using it, it will not be good, but it will be done. It will stick one piece of wood to another. but would you praise the spoon as a hammer replacement?
It didn't matter, those files were done used as input data into Tableau for further processing, where they could carry on doing the work that actually mattered to them.
This is the daily reality of industries whose software isn't the main service, not doing beautiful software to reach HN first page.
Also, you said
> asked IT for VB.NET and were able to quickly proceed with the work that actually mattered to them
I have already addressed this. > We just make it work not because its possible, but because nobody wants to go through the requisition forms.
Edit: Also just insisting that whatever makes it work should be used sounds like a carpenter who is proud of using a spoon as a hammer. Even if you are not a carpenter, I don't think anyone would feel good about using spoon as a hammer in a DIY project.
Of course simple simulation of these features could be easily added, but many of more complex modern language features have to be designed from ground up. But I guess it will be the next learning experience for the author and he can have a lot of fun with it as well.
But rather, than the "shape" of the language I currently implemented is irrelevant. Conditionals and loops are conditionals and loops everywhere. Adding new features isn't easy, but changing how the existing ones look like is. In other words: if you came to this project and left just because BASIC was in the name... well, that's the least interesting part of the whole thing.
I understand the author is not working on this for fame, but BASIC is really underrated as a learning language these days. This could be a pretty good playground for teaching kids programming.
I'm going to be so selfish as to give two suggestions/requests. The first is to have a way to switch to a white background in the editor (I managed to do it in the commandline), since it's hard to use for someone with astigmatism like myself.
The other is some graphics features. They may exist but I didn't find any. Something that I really enjoyed as a kid, learning to program, was to use commands such as LINE, CIRCLE, RECTANGLE etc to draw things on the screen. Being a Commodore 64 user, I didn't hey much opportunity to do that until I got a BASIC extension that supported graphics.
As for the white background, thanks for the information on how it plays out with astigmatism; had no idea! I'm still thinking how to add how some form of configuration so that those customizations can stick. (The new release I published today has support for an AUTOEXEC.BAS, so probably that combined with some global environment variables could do the trick.)
As for graphics, definitely. I want to add the features you mention as well as PLAY for music... but that will require some reworking on how the web UI works and I'm not sure how I'd add those to the CLI. But these are definitely in my mind.
I'll be checking out the native version as well, and looking forward to graphics (if for no other reason than to revive some exploratory progarmming in BASIC that I was doing in my childhood :-) ).
By the way: replying back to your original post because I did not see that earlier. The idea to have a command line vs. an editor you can easily switch to came from Borland Sidekick Plus. I used to use that back in the day on an 8086 to write Clipper code, and toggling between DOS and the resident editor was very cool.
I did read a lot about those TSR tools on DOS though. I didn't realise they had full editors.
In fact, having a lot of users would make things complicated as I would have to stop making incompatible changes if I want to try something new.
Designing your own programming language is such a nice hobby, and something I believe a lot of programmers do. In fact, I would like to see links to other people's programming languages, just to see what people are playing around with at the moment.
Here is my project: https://github.com/lokedhs/array
Not sure whether its being continued in some form, but I feel a python code to compute problems in math and other science subjects needs to be part of curriculum everywhere.
[1] https://twitter.com/heavyinfo/status/1352888793070620672
As for a book... yeah, that'd be nice too. I attempted to write some worksheets earlier with screen-related concepts (rows/columns, cursor positioning) but, well, uncovered enough bugs at the time that I had to put those in the back burner ;) I'll keep thinking about this though, as a few individuals have also asked for something similar.