Getting ready to program in C with GCC on RISC OS
Stuart Swales (1481) 351 posts |
I recently had a quick attempt at getting the FORTRAN cross-compiler built alongside gcc in GCCSDK (hoping to port LAPACK) but stumbled very early and didn’t have time to investigate.
I think a lot of things no longer build off-the-peg in autobuilder. It needs some TLC. A start would be to take copies of the currently-used externals so that when they disappear from the source, we still have something that works. |
Steffen Huber (91) 1953 posts |
I only tried to use it back in the era of Turbo Pascal, and my experience was very bad. It was slow, syntax and semantic checking of questionable quality (typical bad error reporting of early compilers) and only supported original Wirth standard Pascal. There is a reason why all “useful” Pascal dialects extended on that! And while it was running as a part of the DDE in theory, in practice it was hard-to-impossible to interwork it with either C or Assembler code. It is best forgotten. |
Rick Murray (539) 13840 posts |
Ditto. The best thing I ever did at college was to look around the filesystem and discover TurboC (and copy it on to floppy disc). :-)
It was possible. I created a small program written in C, Pascal, and assembler. Mostly for the sake of doing it.
:-) |
Willard Goosey (5119) 257 posts |
Thanks for pointing out ARMforth32! I hadn’t found that one. |
Steve Pampling (1551) 8170 posts |
Presumably in the alternate reality Gavin posted a link for RiscLua6 instead of RiscLua5 and RiscLua7 although he does comment on the differences which amount to 6 & 7 differing in the use of the !SharedLibs for v6 cos it’s dynamically linked. |
Willard Goosey (5119) 257 posts |
I forget if i tried it on the Pi0 or Pi2 but i couldn’t get FORTRAN friends g77 to work. |
Willard Goosey (5119) 257 posts |
XAMOS BASIC seems to work fine on Pi2. Its on riscosports |
Tristan M. (2946) 1039 posts |
I also have Risclua 7 NEON. |
Richard Coleman (3190) 54 posts |
@ David Feugey, |
Steffen Huber (91) 1953 posts |
The canonical Charm website http://charm.qu-bit.co.uk/ is no longer active. I don’t know if it is still available somewhere. |
David Pitt (3386) 1248 posts |
Charm V2.6.6 is here – see ‘Install’. P.S. And it works on the RPi3B+. |
Tristan M. (2946) 1039 posts |
Re1; Lua. I quickly set up my Pi to check what I have. Apparently I have RLua6, RLua6 NEON, RLua6 source, RLua7 NEON etc. |
David Feugey (2125) 2709 posts |
While it was working, I remember of hard crashes when trying to recompile it. |
Richard Coleman (3190) 54 posts |
In what way is Charm broken? I’ve not had a problem getting the last version to recompile itself, but I have noticed recently that whilst you can quit the shell from the iconbar, it doesn’t quit when you do a shutdown, and the Mandelbrot demo is the same so I suspect that something in it’s wimp library isn’t quite right there. Other than that the little time I’ve had to play with it, it seems to work okay. |
David Feugey (2125) 2709 posts |
Hum, I’ll check again :) |
Rick Murray (539) 13840 posts |
Looking back over something, I came across Steve Pampling’s post about keyboard control.
Four thoughts come to mind.
When the keyboard can do that, then we have keyboard control. |
Steve Pampling (1551) 8170 posts |
No idea, I modified things to make desktop stuff work while I was playing with filer. Of course unless that stuff is the active task…
I’d really rather see it in the OS rather a bolt-on/crowbar in.
Implement vs. implement and test? Need sleep, long day at GBBF and a post working imbibe. Repeat tomorrow and Friday and Saturday, then takedown days Sun, Mon, Tue…
Possibly, but without access the source at he probably did so with a |
Rick Murray (539) 13840 posts |
There lies the problem. Yes, it would make more sense/consistency to have such control as a part of the Wimp, but unless it’s going to lay claim to an entire class of keypresses (like cursor-or-Enter-while-holding-Alt), it will run into the problem of prescience – does any given app respond to mouse presses itself?
It’s 2019, Steve. These days people follow the mantra of the agile waterfall devops. Or in English, one is supposed to write any old rubbish and release it and promise bug fixes and updates for about as long as it takes before new shiny-shiny comes and captures the imagination.
Oooh! :-)
Funny. I looked at who was posting and thought, I bet I know what those letters stand for. Have a nice time. |
Steve Pampling (1551) 8170 posts |
What my father used to describe a sloppy short-termism.
Not knowing the code under the bonnet, nor the actual user end1 I’d say that stuff is probably just evidence of differing opinions/approaches. 1 Since Select didn’t work on my new machine I never bought it. |
nemo (145) 2546 posts |
Presses Shift-Logo |
Holger Palmroth (487) 115 posts |
And which SHIFT+LOGO+(key) combination loads this fine extension into the RISC OS source? ;) |
Terje Slettebø (285) 275 posts |
@DavidS I’m sorry to hear about your stroke, and I wish you the very best in recovery. Thanks for the link to your website. I’ve just started looking around, and I’m enjoying this one in particular: https://asmfun.riscos.fr/docs/misc/RO4Me.txt These days, I’ve been installing everything I can find on RISC OS software first on VirtualAcorn, and then recently on my ARMX6. I really enjoy using RISC OS, and it’s something of a bummer to drop out of it to do something on the PC. It just reminds me how much I appreciate RISC OS. Take installing/uninstalling programs: The last few days, I’ve probably tested out more than 100 applications, and since there’s no need to install anything, you can do this in a couple of days. Had this been on the PC, with regular install/uninstall, it would probably been more like two weeks. Moving back to topic: I agree with you regarding responsible handling of resource allocation/deallocation. I prefer to avoid having to deal with these things explicitly by using a language with support for higher-level abstractions, such as C++. Using modern C++, you rarely if ever need to manually handle resources or use raw pointers. There are containers like std::vector, and if you need to manage a resource, there are smart pointers that handles this for you. Oh, and thanks for giving extASM and extAOF a home. :) |
Rick Murray (539) 13840 posts |
I think one of the main things that prepared me for C was college inflicting TurboPascal on us. Now, Pascal is a pretty awful language (thankfully TP has enough extensions to make it usable), but it does introduce the concept of linking together modules (in a far more coherent way than BASIC’s LIBRARY), of having a certain degree of freedom in writing code (a line ends with a semicolon, not a newline), of using a compiler, of having the core language be very minimal and everything else provided as callable functions in libraries, and of thinking about programming in a slightly different way than one would be used to if they only knew things like BASIC. C is similar, only with even more punctuation strewn all over the place (and C++ extracts the urine!). Where a language like BASIC has a rich set of statements to do things (OPENIN, PRINT, MOD, MODE, etc etc), C has… more or less variable handling, structures, loops, and functions and that’s it. Everything else is an external library that you link into the final executable. while many people use the same libraries, it does actually provide a great deal of flexibility. Because everything is provided as “a function”, there’s logically no difference between an “internal” function and one that you’ve written as a part of the program. printf() and init_screen() are equals. This can’t be said for PRINT and PROCinit_screen.
Me too, give or take a year. I might still prototype something in BASIC if I’m not sure of how to approach a problem and want to play around trying all sorts of things. This is because BASIC is “instant gratification”, but its lack of structures quickly makes things become a bit of a mess. I also find I’m a lot more productive in C because one line of C can easily be several lines of assembler, and using snprintf() to construct a string in memory? That would be just painful to do it the tedious and long-winded way.
What, no x86 assembly? ;-) For me, I started with BBC BASIC. Did a little bit of 6502 (mainly abusing &EA to work around annoying copy protection). From there I progressed to BBC BASIC V and ARM assembly. ARM was nice. It was also amusing to be able to have a machine fast enough to do stuff with Econet in real time. Like, you know, listen on the line for logins to pull out the name and password, all conveniently sent in the clear. ;-) From there, TurboPascal and then TurboC. Dabbled with those. I wrote a terminal as the one I had was crap and didn’t do ANSI colour correctly. It needed a bit of x86 code inlined in order to bypass the BIOS serial routines that were slow. I didn’t need much assembler but saw enough x86 to think it was the most horrid thing I’d ever seen. Okay, that’s a bit of hyperbole – I’ve seen half-dead old people puking blood into a bucket that I’m holding for them (cancer can be unimaginably evil) and not even x86 gets close to that level of “ohmygod”. But it tries. ;-) I wanted a blog system on my site, to be better than that mess of simple HTML files that I had been using (updating the calendar was becoming a problem). The thing was, I didn’t have access to any SQL database at the time, so it would need to be done as a flat file setup. Which… didn’t seem to exist. So I taught myself PHP and wrote my own. It’s probably really crap, but it works, and seems pretty solid. When my site got hacked (a long time ago, a different person running the server), it appears to have been a validation failure of something SQL on a different site, but once you’re in and have access to the underlying filesystem, it’s game over for the entire host. And… that’s about it. I never bothered to learn JavaScript. In the days when I was interested, it was The Browser Wars and changing far too much. If I needed any script, it was just as easy to find an example and copy it. It’s a lot like C, so understandable enough.
I’d prefer to view the world from afar. Like, “a little white dot in the sky” style of afar. Because I’ve been exposed to far too much madness in my 47 years, much of it happening in the last decade. And, this isn’t Aldershot, so I’ll end it there. It’s also gone sunset and too many mosquitos, evil little bastards managing to sting me through my clothes. That’s not playing fair. :( |
Rick Murray (539) 13840 posts |
What, an abusive relationship? The moral here, boys and girls, is that just because you can do dumb things in C…doesn’t mean you should do dumb things in C. ;-) |
Julie Stamp (8365) 474 posts |
Please edit the output out of your post David, it is too long. |