9 ms·
PureBasic switches to a C backend
- mdp2021 5y agoPureBasic is one of the best things in life (if I may express my view). -- The switch from FSAM to GCC slows down the compilation time. What about the compiled software speed? Edit: the linked post is a few months old. In a later post, Fred (Laboureur) mentions an example of a +50% speed increase.
- ghostly_s 5y agoWhat is your use case for BASIC?
- Koshkin 5y agoI fondly remember Visual Basic 6 as one of the best general purpose development tools for Windows I have ever seen. As to the “use case”, it still seems like a nice interpreted language for tiny computers based on microcontrollers and for embedded platforms in general.
- jamesdwilson 5y ago20 year developer here who's touched many many different software stacks. Still to this day, nothing has lived up to the hype that was actually delivered by VB5 and VB6. Insane productivity.
- resoluteteeth 5y ago> Still to this day, nothing has lived up to the hype that was actually delivered by VB5 and VB6. Insane productivity. People seem to say this a lot but I don't really understand it, because if you use c# with winforms in visual studio it's basically the same thing but better.
- laumars 5y agoDepends on the domain. C# is undoubtedly a lot more powerful and C# runs faster, but your average C# program requires writing a hell of a lot more boilerplate code than your average VB6 program. Visual Basic had its warts. C# is a better language from an academic perspective. But VB filled a niche that nothing else has come close to: it made desktop application software writing ridiculously quick and easy. While still being maintainable, readable, and fun. Electron is probably the closest thing we have to that in the desktop world these days but somehow that performs even worse than VB6 did. Python or Go is probably the most analogous, if you think about command line programs.
- teh_klev 5y ago> but your average C# program requires writing a hell of a lot more boilerplate code than your average VB6 program Not actually true. I just created a new C# Windows Forms application in VS, dragged a button onto a form, double clicked and it took me right to the event handler ready for me to do something. There's no additional boilerplate or ceremony required. Now sure there may be a whole bunch of code sitting in the "Form1.Designer.cs" partial class, but that's for the designer to manage, not you. And VB had this as well but the VB environment hid this until you went looking for it. Writing Windows Forms apps in C#/VS2019 is as easy as it was back in the VB5/6 days. I say this as a former VB4/5/6 (and, cough, ahem, MS Access) user knocking out all sorts of stuff back in the 90's.
- laumars 5y agoThere’s more to writing software than just dragging a button onto a form ;) at some point you’re going to want to write your own classes, or manage the existing automatically generated ones. I’ve written sizeable software in both VB6 and C# (both professionally too) and yes, what I said is true about C# being a more verbose language. This isn’t intended as a criticism of C# either. It’s just a natural side effect of C# giving the developers more control. Plus there’s also a C vs ALGOL type argument with regards to which is easier for a newbie to read and write. C# might produce highly readable code to those already familiar with C-syntax but VB6 is ostensibly executable pseudocode. That alone counts for a lot when talking about the accessibility of programming languages.
- icedchai 5y agoIt is sad to think we gave all that up for HTML/CSS/JS. Now, with "modern" tools, it takes a whole village to build and submit a simple form.
- pjmlp 5y agoMore insane are the younger generations that grew up with the Web, have no idea how productive native tooling can be and then give us Electron based crap.
- littlecranky67 5y agoIts not HTML/CSS/JS that killed the RAD tools from the 90s/00s - it is security, multi-user and networking. I remember how quickly you can put together apps and forms using VB6 + visual designer. But security/permissions were mostly based on your Windows account user. I remember an ERP software that hardcoded the MySQL connection string with a god-mode user+password in a config file and relied on Windows permissions that only the ERP software itself (written in Delphi) could open it. User permissions were then encoded in that DB. Basically, one disassembly of the machine and extracting the config file from the harddrive would have allowed you full access to the db. Today, we use service layers (REST & Co.) to ensure permissions and access - something that would be equally complex when using VB/Lazarus today.
- icedchai 5y agoI'm not convinced RAD tools couldn't have been made to work with REST services or something else, like SOAP. SOAP probably would've been better for this. As much as I hated the complexity of SOAP, being able to generate clients from a WSDL was pretty cool.
- spullara 5y agoUsing Microsoft's Jview JVM COM-Java integration (this is like '98 time frame) you could more easily run VB 6 apps against Java application servers because you only needed to distribute the client jar to the VB app. Since there was no early binding you didn't need the code you were going to call remotely on the client, it could just download the classes at runtime and use reflection to make the required calls. Drastically reduced any sort of jar/dll hell.
- mdp2021 5y ago> your use case for BASIC Answering not really about 'BASIC', but "PureBasic" (it is not the abstract language but the product). Personally: Whenever I want to do some fast coding. And then, in my case, basically all of my personal desktop applications and compiled shell commands. Because really, it is so pleasant to code on it. In general: When you want a lightweight, efficient, specialized environment to quickly get things done, in a framework that is close to low-level (memory structures etc.) and want a compiled result. And about the "BASIC" part: the BASIC implementation of PureBasic is practically not that different from "reasoning in C" (and you can use the C libraries upon need), but the PB libraries and the IDE makes writing comfortable. I basically never found a better alternative around this concept: light, powerful, fast, low-level, comfortable.
- tored 5y agoInteresting project. What do you use it for?
- mdp2021 5y agoOn the desktop OS, almost everything (but it must be me). Data manipulation, programming "calculator" (suppose you need to compute something, but with loops conditionals and functions), "/usr/bin" commands, desktop widgets (say, the interface to granularly set the brightness on my laptop), desktop applications (really all sort of things here - anything with a GUI). An example comes to mind of something pending: there is a recorded debate I should listen to, but of the three participants one is a screamer-in-the-mike and another a low-bass-baritone-in-the-distance. Loop through the audio data compressing the "hypnotist" and the "maniac" at similar amplitude levels, using different wave transformations at different times and with continuity, then compile a command for future cases: a task for your swiss-army-knife PureBasic. In a way, there is a specific spirit behind it: you are given a computer: the most basic, natural thing you want to do it is code on it. PB represents for me "the default coding system that should have come with the OS" - as some computers had decades ago.
- Koshkin 5y agoShouldn’t the backend compiler be a configurable option?
- chrisseaton 5y agoMaintaining multiple backends isn't fun.
- codr7 5y agoRunning the same C code through different compilers is totally doable though.
- howerj 5y agoThey could use the Tiny C Compiler if compile speeds become a concern, although it supports far few platforms and generates much slower code.
- DaiPlusPlus 5y ago(Off-topic, but if anyone from PureBasic.fr's web team is here, please please please don't use country's flags to represent languages, just put the language name instead - if you want a visually distinctive but recognizable icon then use a wireframe globe icon)
- jeroenhd 5y agoI don't really see the problem for this website, the languages supported are all European, named after the country they're originally from, (with perhaps US English as the odd one out). Things might start getting confusing in countries like India, of course, but I don't see the problem in this specific case. I do have a problem with their homepage related to languages though: you can't get from English to Spanish or Italian on mobile without going through some weird state machine of what language makes sense to list next. There's always the option to switch to English, but I can't see Italian or Spanish from every other page.
- Rygian 5y agoThere are countries within Europe where many different languages are spoken.
- skissane 5y ago> I don't really see the problem for this website, the languages supported are all European, named after the country they're originally from, (with perhaps US English as the odd one out). As a non-American native speaker of English (Australian), I always feel a little bit excluded when I see an American flag used to represent my native language. I'm not bothered by the UK flag to quite the same extent – can't deny the language originated in England (although maybe one should really use the English flag not the UK one) But I think the ideal is to drop the flags and just call them by their native names – English, Français, Deutsch, etc. Or use ISO 639 codes – EN(G), FR(A), DE(U), etc. (Non-technical audiences might find the codes unfamiliar, but for a programming language website that shouldn't be a concern.) Nobody is going to feel excluded, even in the slightest, by either of those approaches.
- dng88 5y agoThe home page is a very good read : https://www.purebasic.fr/blog/ https://www.purebasic.fr/blog/
- classichasclass 5y agoAs a "big flat file" -- does that mean things like PB_MessageRequester(), SYS_InitString(), etc., are also in the source code, or in a source library? If the source for those aren't included, then it's not really portable beyond the platforms it already supports.
- sedatk 5y agoThey could still have cross-platform versions of the same library and choose which to use at the linking phase.
- classichasclass 5y agoI'm sure they do, for the platforms they already support. But the blog post talks about using the C code to run on other platforms. I don't think there's a library for my ppc64le workstation.
- codr7 5y agoWouldn't Lazarus be a better option in most cases? No silly 800 line limitation, more powerful language, at least as portable etc.
- sigzero 5y agoThere is a lot of nostalgia with BASIC I suspect but I agree.
- jlawer 5y agoAhh the VB vs Delphi War..... That brings back memories. I agree that Lazarus looks more mature, however shifting to a pure C backend would actually allow them to be more portable as I believe Lazarus uses FPC which can use a LLVM backend. While LLVM supports most modern platforms, there are lots of less popular architectures that lack LLVM support. Personally I never liked using any basic derived language for "Real work", but not sure if that was because I was a Delphi guy.
- coder543 5y agoThe list of supported platforms for FPC is pretty impressive[0], whereas LLVM support in FPC appears to be very new, and FPC has very limited platform support using LLVM anyways[1]. LLVM really means nothing for FPC's portability story at this point, as far as I can tell. I'm skeptical that targeting C opens up any meaningful additional platform support beyond what FPC natively supports. Even relatively new and/or niche architectures like RISC-V and Xtensa appear to be supported by FPC. (C code also isn't perfectly portable by any stretch of the imagination, so just having some random C compiler for your platform of choice and some emitted C code doesn't really guarantee that you'll end up with a compatible, working solution.) I've never used Lazarus or FPC beyond just opening it up and playing with it in years past, but it is interesting how much that ecosystem seems to offer. [0]: discussed in the first paragraph here: https://www.freepascal.org/ https://www.freepascal.org/ [1]: https://wiki.freepascal.org/LLVM#Progress https://wiki.freepascal.org/LLVM#Progress
- mercurialuser 5y ago
- conz 5y agoFor anyone still interested in 'Visual Basic' style application development, or for RAD development in general, take a look at Gambas: http://gambas.sourceforge.net/en/main.html http://gambas.sourceforge.net/en/main.html Gambas is a mature, current-generation OO BASIC, has a vast array of libraries, a JIT and is completely open source software.