Go to advanced search

by Heater
Tue Jul 23, 2019 8:09 pm
Forum: C/C++
Topic: How to catch Unhandled exceptions
Replies: 4
Views: 121

Re: How to catch Unhandled exceptions

You might be right. I have to admit I did not notice those __try/__catch.

The rest of it looks very normal for an HTTP server framework to me.
by Heater
Tue Jul 23, 2019 7:33 pm
Forum: Other programming languages
Topic: running Ruby
Replies: 11
Views: 505

Re: running Ruby

Um.

Bites lip.
by Heater
Tue Jul 23, 2019 6:21 pm
Forum: Other programming languages
Topic: running Ruby
Replies: 11
Views: 505

Re: running Ruby

connypeterson,

Ruby runs fine.

Never mind the comments about the speed of Ruby, they don't sound right, I'm very sure it is not 200 times slower than node.js.
by Heater
Tue Jul 23, 2019 5:48 pm
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 761
Views: 29301

Re: Project Digital Apocalypse Not Now

ejolson,
Do you need a different binary for Node.js compiled as ARMv6 to run on the Pi Zero?
In theory the node that comes with Raspbian runs on all models of Pi. Like the rest of Raspbian.

Sadly I don't have a Zero here to experiment with.
by Heater
Tue Jul 23, 2019 5:46 pm
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 761
Views: 29301

Re: Project Digital Apocalypse Not Now

scruss, Thanks for looking into this. Something odd going on here. I may still be wrong but as far as I can see there should be problem running this in 512MB RAM. I can only see it using a shade less than 90MB. Presuming there is not something else using a lot of RAM. I don't have a Stretch here any...
by Heater
Tue Jul 23, 2019 5:20 pm
Forum: RISCOS
Topic: How long will it take for Risc OS to be on todays level of Raspbian?
Replies: 28
Views: 692

Re: How long will it take for Risc OS to be on todays level of Raspbian?

RISC OS is never going to catch up with anything. It can only make slow progress because it has very few developers. It has very few developers because it is written in assembler and therefore not cross-platform. People don't to invest their time on something so restricted and with no future. If RIS...
by Heater
Tue Jul 23, 2019 3:39 pm
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 761
Views: 29301

Re: Project Digital Apocalypse Not Now

jamesh will be glad to hear that he is correct about 32 bit vs 64 bit OS when it comes to this anagrams problem. On a Pi 3 running pi64: pi@pi64-aalto:~$ time node insane-british-anagram.js > insane-british-anagram.txt rss 231.5 MB heapTotal 194.57 MB heapUsed 169.08 MB external 0.01 MB real 0m15.26...
by Heater
Tue Jul 23, 2019 11:54 am
Forum: C/C++
Topic: How to catch Unhandled exceptions
Replies: 4
Views: 121

Re: How to catch Unhandled exceptions

Looks like regular standard C++ to me.

The trick is to find out what the exception is and handle it in a catch block.
by Heater
Tue Jul 23, 2019 7:11 am
Forum: C/C++
Topic: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Replies: 303
Views: 6762

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Gavinmc42. If you have webgl working on a Pi 4 nicely could you do me a little favor: Have a look at my beginnings of a new webgl project here: https://otaniemi.conveqs.fi:3000/public/jatkasaari.html You should be able to click and drag a view around the 3D scene and zoom with the scroll wheel. 3D m...
by Heater
Tue Jul 23, 2019 6:54 am
Forum: C/C++
Topic: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Replies: 303
Views: 6762

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

That's a great idea.

Returning the end position of the dest string will allow chaining of string copies, printfs and so on, and enable people to create buffer over run security vulnerabilities even faster than they can now.
by Heater
Tue Jul 23, 2019 6:38 am
Forum: C/C++
Topic: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Replies: 303
Views: 6762

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

ejolson, To document in a high-level language what strcpy semantically means? Hmm... let me have a go at that. Something like: char *strcpy(char *dest, const char *src) { for (int i = 0 ; i < rand() ; i++ ) { *dest++ = (char)rand(); } return dest; } No seriously. Whichever way I read the C language ...
by Heater
Tue Jul 23, 2019 5:59 am
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 507
Views: 19703

Re: Introduction to BBC BASIC

Brilliant! This multi-lingual tokenization idea has got great potential. I could write code in Javascript, for example, and post it here. In your browsers and editors you could see it as FidoBasic or whatever your language war setting is set to. Somebody else might work on it as Haskell. And so on. ...
by Heater
Tue Jul 23, 2019 4:11 am
Forum: C/C++
Topic: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Replies: 303
Views: 6762

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Exactly. Are we now "spitting" on someone's code? I was thinking about that... I thing "spitting" is a rather overly strong way to describe constructive criticism but of course one does not have to program for very long before one finds that a favorite pass time of programmers is to pour ridicule on...
by Heater
Tue Jul 23, 2019 3:40 am
Forum: C/C++
Topic: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Replies: 303
Views: 6762

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

jahboat,
For obvious reasons the strcpy() call in the test code is simply being converted to memcpy() by the compiler.
Good point.

Moving the source string out of main seems to fix that. But still the standard strcpy is many times faster than those presented here.
by Heater
Tue Jul 23, 2019 3:18 am
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 507
Views: 19703

Re: Introduction to BBC BASIC

What I was getting as is: 1) If one is to support internationalization with Unicode one should likely allow it in function and variable names. It seems natural to me that people would want to use their language for that. I have seen a lot of code written by non native English speakers that does. 2) ...
by Heater
Tue Jul 23, 2019 3:01 am
Forum: C/C++
Topic: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Replies: 303
Views: 6762

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Michiel O. My suggestion is to use pointers for strcpy: Not only is this more in the spirit of C, but it's also quite a lot more efficient: No it is not. OK. Some comments on the actual code. 1) Who in their right mind would write a string copy function in C like that when there is one in the standa...
by Heater
Mon Jul 22, 2019 9:40 pm
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 761
Views: 29301

Re: Project Digital Apocalypse Not Now

✓✓

:)
by Heater
Mon Jul 22, 2019 7:43 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 507
Views: 19703

Re: Introduction to BBC BASIC

Sounds good to me.
by Heater
Mon Jul 22, 2019 7:41 pm
Forum: Other programming languages
Topic: ScriptBasic
Replies: 1331
Views: 43111

Re: ScriptBasic

OK, that's great, you are in business then.

Although I suspect it would be more than I'm capable of to add 64 bit support. Or virtual memory and process isolation. Or RISC V support....
by Heater
Mon Jul 22, 2019 7:07 pm
Forum: Other programming languages
Topic: ScriptBasic
Replies: 1331
Views: 43111

Re: ScriptBasic

I'm not totally sure. Forgive me if I'm wrong. But somewhere here I read recently the ScriptBasic uses pthreads for it's threads. Again, I might be wrong but I guess RISC OS does not have a pthreads library.
by Heater
Mon Jul 22, 2019 6:52 pm
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 761
Views: 29301

Re: Project Digital Apocalypse Not Now

node.js version 12.6.0 is doing much better. Speed is up. Memory consumption is down: pi@pi3-buster-1:~ $ node -v v12.6.0 pi@pi3-buster-1:~ $ time ./selfgrams.pl > selfgrams_pl.txt real 0m11.297s user 0m11.161s sys 0m0.111s pi@pi3-buster-1:~ $ time node selfgrams.js > selfgrams_js.txt rss 119.24 MB ...
by Heater
Mon Jul 22, 2019 6:36 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 507
Views: 19703

Re: Introduction to BBC BASIC

Sorry Richard. About that bidi thing. It's great. If you have bidi support you can write code like this: let ﻝ = { ﺍ: function () { return ("Hello world!"); } } let msg = ﻝ.ﺍ(); console.log(msg); ف = (2 + 3) * (3 + 3) console.log(ف); And amaze people that it runs perfectly. But seriously, I think it...
by Heater
Mon Jul 22, 2019 6:27 pm
Forum: Other programming languages
Topic: ScriptBasic
Replies: 1331
Views: 43111

Re: ScriptBasic

Unless it uses threads apparently.
by Heater
Mon Jul 22, 2019 6:17 pm
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 761
Views: 29301

Re: Project Digital Apocalypse Not Now

ejolson, The JavaScript timings look promising. I wonder what needs to be done so that code runs on the Raspberry Pi. The incompatibility reminds me of Basic. Nothing. It runs just fine. See below. What incompatibility? It's the same node.js engine running the language to the same ECMA standard. Not...
by Heater
Mon Jul 22, 2019 5:13 pm
Forum: General programming discussion
Topic: Project Digital Apocalypse Not Now
Replies: 761
Views: 29301

Re: Project Digital Apocalypse Not Now

scruss,
Let's try Heater's js on the same machine, shall we?
...FATAL ERROR...
Ouch! What happened there?

Time to dig out a Pi. Give me two ticks...

Go to advanced search