3 ms·
Show HN: ClifferBasic, a simple BASIC interpreter as a .NET REPL
Ever since I got my first computer, a TI-99/4A, at age 13, I've been fascinated by programming languages. I've written a few interpreters, but this is the first time I've come back to the first language I've ever learned, BASIC. I started ClifferBasic as a way to shake out bugs and find feature weaknesses in another project I'm working on, Cliffer, which is a library for writing CLI applications in .NET using attributed program, but it's taken on a life of its own and has become a rather fun project. I'm planning to flesh out the BASIC implementation over the coming weeks, but I'd like some input from the community to see where I could take it next. Thanks for your time!
- giancarlostoro 2y agoI'm seeing my career basically go head first into .NET despite my attempts at going all in on Python, Visual Basic 6 was my first language followed by C#, and in college, the moment I learned about preprocessor directives in C I did what probably everyone who likes BASIC and learns C has done, define BEING and END as { and } respectively... to the horror of C developers everywhere. I think .NET is a fantastic platform, and I'm still surprised there's not more attempts at building languages on top of it, especially when you consider how IronPython was built to "prove" .NET was a terrible platform, but the Jython developer fell in love with .NET as a result of his attempt, heck, Microsoft hired the developer! At least thats how I've heard the story told on random HN comments over the years. :) I havent had the pleasure of building a full interpreter yet, so props on doing the work. Edit: A few weeks ago I tried VB .NET and theres something nice about it, it feels like when I write some pieces of code, I can verbalize what it is, instead of some obscure character someone gave a meaning to, but building out VB .NET projects means translating C# to VB .NET the entire time, since most .NET things today are all in C# and it can be more effort than just writing in C#. There is something really nice and almost elegant about BASIC. My only complaint with Microsoft was that VB6 made native binaries, I wish they had done VB7 with threading support before .NET became a thing. I REALLY hope they open source Visual Basic 6 with the MIT License, would love to see what might happen if people fork it and make improvements to it...
- munificent 2y ago> define BEING and END as { and } respectively I know this is a typo, but I love the idea of using "BEING" and "END" as delimiters. Maybe "BIRTH" and "DEATH".
- giancarlostoro 2y agoHaha I didn't even notice, glad everyone understood :)
- tomcam 2y ago> Maybe "BIRTH" and "DEATH" Constructors and destructors
- WillAdams 2y agoOne rather charming attempt is: https://github.com/VBAndCs/sVB-Small-Visual-Basic https://github.com/VBAndCs/sVB-Small-Visual-Basic
- starik36 2y agoVB7 would have been nice. They were missing a couple of key features that prevented it from being true OOP language. As far as open sourcing it... I think one of the people who worked on VB6 (can't remember the name) mentioned on a podcast that it's impossible to open source it because it uses all sorts of proprietary libraries from 3rd parties. The effort to track down the rights holders 20 years later would be a real challenge and not even a guarantee that they would go along with it.
- giancarlostoro 2y agoThat's a shame, I would be alright with a stripped down version of it that has only the Microsoft specific as open source. I'm mostly curious given an open source release of it, how much would the wider open source community work on it. We saw that Go despite its core maintainers not porting it to Windows, got ported to Windows by the community.
- pjmlp 2y ago
- jasperry 2y agoThis is great. It makes me think there's something about the simplicity of a line-based interface for both editing and running code that we could still learn from in today's tooling. The interface to BASIC programming had to be simple because the only way you could do anything was by typing at the next line. But due to that very limitation, there was less friction from context switching. I think that's something that hasn't been fully recaptured even by advanced current REPLs.
- WorldMaker 2y agoSomething fun to compare your efforts against is Small Basic: https://smallbasic-publicwebsite.azurewebsites.net/ https://smallbasic-publicwebsite.azurewebsites.net/ (https://github.com/sb https://github.com/sb) [0] That's also a BASIC built in .NET. It's focus is on "pedagogy" (teaching programming a step at a time in a revealing pattern sort of way), and offers a lot of fun silly things like a Turtle module and other basic GUI tools. [0] Apparently not to be confused with SmallBASIC, a C/C++-based somewhat math-focused one: https://github.com/smallbasic/SmallBASIC https://github.com/smallbasic/SmallBASIC