11 ms·
Why am I wasting time on EndBASIC?
- _tom_ 6y agoLOL. 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.
- _tom_ 6y agoOk, I just made the repository public, in case anyone is curious: https://github.com/cocode/TrekBASIC https://github.com/cocode/TrekBASIC
- ryandrake 6y agoNice, I remember vividly being 11 years old and typing this line by line into a Commodore 64, carefully reading it from a ragged copy of “101 BASIC Computer Games”. Took me three days to get it right. I slept next to the computer so my dad wouldn’t turn it off by mistake. Later ended up porting it to Pascal and adding graphics, in an attempt to learn the language.
- benibela 6y agoI still write almost all my code in Pascal Why am I wasting time on Pascal?
- mysterydip 6y agoIf Pascal does the job, why not?
- butterisgood 6y agoThere are modern iOS games written in Delphi last time I looked around. 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 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 :-)
- jes5199 6y agoPascal was my first language, and I really miss some things about it that didn’t make it into the popular modern languages
- stevekemp 6y agoI wrote a simple BASIC too, for nothing more than a sense of nostalgia: https://github.com/skx/gobasic https://github.com/skx/gobasic
- xkriva11 6y agoOld Basics had quite impressive debugging features. It had breakpoints (STOP), you were able to inspect and change the content of the variables, change code before or after the breakpoint - and even on the same line - and then CONTINUE from the interruption point. Even ZX80 with 4 KiB of ROM (Basic + OS routines + 0.5 KiB character table) was able to do that (except modification of the same line because it had one command per line only)
- jmmv 6y agoThey indeed are. As I keep referring to the Locomotive BASIC manual and the QuickBASIC builtin help to implement my version, I'm amazed at how many features those had. Especially the latter was a great IDE even when compared to today's standards.
- Doctor_Fegg 6y agoLocomotive was a great dialect. Fully featured and consistent with few of the arcane incantations that other 8-bit BASICs had.
- perl4ever 6y agoI would like to use LLVM, to target basic (perhaps VBA or VBScript). Or the JSON used by Power Automate. But it's probably beyond my capabilities.
- Koshkin 6y agoYou’d probably spend more time learning LLVM than what it might take you to reinvent your own parsing method. (For relatively simple cases I usually recommend flex and bison, they are simple tools that can do wonders.)
- perl4ever 6y agoSorry I wasn't clear. Making a backend module for LLVM would presumably allow me to translate a lot of languages into VBA or Power Automate, or maybe Power Query M which is something I'd like to do because I am not a SWE and my machine is locked down at work, and it's more interesting/amusing to work around that than to get myself into a developer position. 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.
- sitkack 6y agoThis article on running Wasm on the Roku is exactly what you need. https://motley-coder.com/2020/12/20/webassembly-on-roku/ https://motley-coder.com/2020/12/20/webassembly-on-roku/
- perl4ever 6y agoThank you! That looks very similar to what I have been idly dreaming of.
- hakfoo 6y agoOn the page, he comments roughly "Basic isn't the language of the future" and makes a joke about the wide usage of Visual Basic. 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.
- newswasboring 6y ago> 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. 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
- JohnStrangeII 6y agoIt's not just for legacy purposes. I've written a few useful personal tools in Purebasic, for instance. BASIC dialects tend to provide the functionality needed and can be handy for quickly throwing something together when you don't have the time to deal with GUI frameworks and complex libraries. You can also use Python or Go, of course, but they do not have integrated IDE and do not have a rich command set in the core language. Easy deployment and compact executables are also a plus of some existing BASIC dialects. If I had the money / the investment in a license would give me a good ROI, then I'd also pay for Xojo, for example. Whatever gets the job done without wasting time.
- amelius 6y agoPlease make it work on microcontrollers. And write a book aimed at children to go with it.
- pjmlp 6y agoI think MicroPython already claimed that place.
- teddyh 6y agoOr Snek.
- jmmv 6y agoThat'd be nice indeed. As part of the 0.5 release I have just published, I split the language core from the standard library to ensure the former remains as small as possible. So far, it's at 2,500 lines of non-test code and about 480kb compiled. Not the tiniest, but not too huge! (I know, possibly still huge for microcontrollers, but I'm not too familiar with that domain.) 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.
- bovermyer 6y agoThis is akin to the "Forever Project" concept described by Scott Turner of Here Dragons Abound: https://heredragonsabound.blogspot.com/2020/02/the-forever-project.html https://heredragonsabound.blogspot.com/2020/02/the-forever-p...
- jes5199 6y agoooh, this hits at some things I’ve been seriously struggling with. thank you for the link
- jmmv 6y agoHello everyone! Original post/project author here. 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 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!
- retr0nerd 6y agoCool stuff, man! 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.
- jes5199 6y agoI’ve recently unearthed a copy of WORM.BAS that is written to run on ZBasic for the Zenith Z100 - it’s the version of “snake” I played as a child. I wish I had an interpreter that could run it, but it relies on the Z100’s direct access to the RAM that holds the text mode font, in order to overwrite the letter shapes with bitmaps of sections of the worm/snake. I have, more than once, tried to port it to a modern context, but the old coding style (no explicit subroutines, just GOSUBs) is very hard to read and even though it is not a lot of lines of code, it is a very painstaking process. I don’t know if hacking a BASIC interpreter would help, but it might!
- vzaliva 6y agoThis statement is little naive: "If I wanted to change the language per se to offer a more “modern” experience with things like first-order functions, objects, etc. it’d be trivial to do so." 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.
- jmmv 6y agoThe point of that comment wasn't to say that implementing all language features is trivial, nor to say that designing a language from the ground up is easy. 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.
- lokedhs 6y agoThis post mirrors my feeling on this topic as well. Just like the author, I'm also working on a programming language which will not be used by a lot of people. 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 https://github.com/lokedhs/array
- sigzero 6y agoBECAUSE is a great reason to do it.
- lokedhs 6y agoI tried the online version and it's really neat. I really like the idea of having a commandline but also an editor you can easily switch to. I have only seen this implemented once before (the BASIC that is shipped with RiscOS). 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.
- jmmv 6y agoThanks for trying it out and for your suggestions. 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.
- lokedhs 6y agoThanks for taking the time to reply. As for the colourscheme, perhaps just a simple toggle button on the web UI to allow for easy switching between light/dark? 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 :-) ).
- jmmv 6y ago
- pjmlp 6y agoWhile this one was done in Rust, I keep thinking someone will eventually come around with a QuickBasic to WASM compiler, written in QB64. :)
- Abishek_Muthian 6y agoI recently learnt that 80's high school math text book in U.S. had BASIC program for graphing calculator[1], I felt that's a great way to teach programming. 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 https://twitter.com/heavyinfo/status/1352888793070620672
- jbirer 6y agoDo not underestimate the power of passion and hobby projects. I messed around with RISC-V assembly for my own pleasure last year and ended up landing a short contract on it later.