User avatar
John_Spikowski
Posts: 1614
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: Project Digital Apocalypse Not Now

Sun Jul 14, 2019 3:53 pm

For those working on the ScriptBasic memory leak with GMP, can you migrate to the ScriptBasic thread?

Let's kept this thread fibo challenge related.

ejolson
Posts: 5422
Joined: Tue Mar 18, 2014 11:47 am

Re: Project Digital Apocalypse Not Now

Sun Jul 14, 2019 5:12 pm

ScriptBasic wrote:
Sun Jul 14, 2019 3:53 pm
For those working on the ScriptBasic memory leak with GMP, can you migrate to the ScriptBasic thread?

Let's kept this thread fibo challenge related.
In a way the memory leak is related to the Fibonacci sequence, because it was discovered while computing the same.

The cooperative story of one person discovering a problem, convincing the maintainer there is a problem and another person having the skills and insight to find the cause of that problem is essential, if open-source software development is going to remain competitive compared to the automated training of deep-learning convolutional neural networks. From an educational point of view, this story also illustrates the importance of understanding what a memory leak is and how garbage collection works in a language such as Basic.

The question then remains, what first programming languages could effectively support teaching the fundamental concepts of memory allocation and management?

Heater
Posts: 15997
Joined: Tue Jul 17, 2012 3:02 pm

Re: Project Digital Apocalypse Not Now

Sun Jul 14, 2019 5:48 pm

ejolson,
The question then remains, what first programming languages could effectively support teaching the fundamental concepts of memory allocation and management?
Sounds to me like a start with machine code (assembler) would be good. So that the student at least gets an idea of what memory is. As opposed to "variables" and other such abstract concepts.

Heck, that is what one learns by toggling instructions into a machine via it's front panel switches. Or in my case having to prepare hexadecimal on paper tape for a PROM programmer.

Then move to C, where that messy memory allocation stuff is wrapped up in malloc().

As I have said here before, I think my tech school had it right in 1974. They introduced us to programming with BASIC and assembler almost simultaneously.
Memory in C++ is a leaky abstraction .

Andyroo

Re: Project Digital Apocalypse Not Now

Sun Jul 14, 2019 6:04 pm

Heater wrote:
Sun Jul 14, 2019 5:48 pm
... They introduced us to programming with BASIC and assembler almost simultaneously.
Agree totally, it gives you a much better understanding of how high level languages work even though the compilers make it a snap to get code in the machine now...

I had BASIC on the council mainframe via acoustic coupler and locally we got SC/MP, 6502 and 8080 assembler via hand assembly all at the same time :shock: My tutor then managed to convince the council to add Fortran and Algol to the stack so he could show us the differences in 'high level' languages rather than just assembler.

User avatar
John_Spikowski
Posts: 1614
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: Project Digital Apocalypse Not Now

Sun Jul 14, 2019 6:29 pm

The canine programmer became barking mad and growled, please keep on topic--that's the wrong kind of apocalypse.
My post to move the leak to another sink was based on this "keep on topic" request.

Heater
Posts: 15997
Joined: Tue Jul 17, 2012 3:02 pm

Re: Project Digital Apocalypse Not Now

Sun Jul 14, 2019 6:49 pm

It may have escaped every ones attention but it's too late already. The Digital Apocalypse has already happened. A long time ago.

Give or take a few months I can pin point it to the summer of 1976.

There is nothing we can do anymore. As the kids like to say today "Resistance is futile"

I can expound on this more if anyone is interested in the happy time before our digital overlords and how they took over.
Memory in C++ is a leaky abstraction .

ejolson
Posts: 5422
Joined: Tue Mar 18, 2014 11:47 am

Re: Project Digital Apocalypse Not Now

Sun Jul 14, 2019 6:50 pm

ScriptBasic wrote:
Sun Jul 14, 2019 6:29 pm
The canine programmer became barking mad and growled, please keep on topic--that's the wrong kind of apocalypse.
My post to move the leak to another sink was based on this "keep on topic" request.
It might be best to ignore most of what Fido purportedly says, especially the part about n-level meta programming.

In this case, the request you quote was part of a drama in mock protest to me talking about the zombie apocalypse instead of a digital one. That furry canine seems further frustrated by a lack of excitement for the Fidonacci numbers and the resulting rabbit breading experiment.

I've updated that previous post to make the zombie reference clear. Sorry for the misunderstanding.
Last edited by ejolson on Sun Jul 14, 2019 7:06 pm, edited 4 times in total.

User avatar
John_Spikowski
Posts: 1614
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: Project Digital Apocalypse Not Now

Sun Jul 14, 2019 6:52 pm

I have to say I'm proud of ScriptBasic for taking a Heater beating and not taking a fall.

ejolson
Posts: 5422
Joined: Tue Mar 18, 2014 11:47 am

Re: Project Digital Apocalypse Not Now

Sun Jul 14, 2019 7:13 pm

Heater wrote:
Sun Jul 14, 2019 6:49 pm
It may have escaped every ones attention but it's too late already. The Digital Apocalypse has already happened. A long time ago.

Give or take a few months I can pin point it to the summer of 1976.
Is that the year you graduated?

User avatar
John_Spikowski
Posts: 1614
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: Project Digital Apocalypse Not Now

Sun Jul 14, 2019 7:18 pm

In 76 I was working for Harris Intertype baby sitting their Assocaited Press client in Chicago.

Heater
Posts: 15997
Joined: Tue Jul 17, 2012 3:02 pm

Re: Project Digital Apocalypse Not Now

Sun Jul 14, 2019 7:24 pm

ejolson,
Is that the year you graduated?
Nope. The summer before I got into uni.
Memory in C++ is a leaky abstraction .

Heater
Posts: 15997
Joined: Tue Jul 17, 2012 3:02 pm

Re: Project Digital Apocalypse Not Now

Sun Jul 14, 2019 7:27 pm

ScriptBasic,
I have to say I'm proud of ScriptBasic for taking a Heater beating and not taking a fall.
Anecdote time:

When I was contracted to Racal for work on their printed circuit board design CAD package back in the day, I discovered a wonderful bug...

I found that if one was drawing a route segment, moving the end point around with the mouse, and one happened to drop that end point on the coordinate origin (0, 0) then the program crashed out in a spectacular way. It would draw the entire content of the machines memory as route segments all over the screen!

Who would ever do such a stupid thing?

It seems I have always had an intuition for finding those obscure cases in software that cause mayhem. Even if I knew nothing about the software itself.

This whole memory consumption business with ScriptBasic and the GMP extension is yet another example.

Do not worry. Despite this awesome power I have never brought down a software product by finding bugs in it.

Not that that is is ever my intention. The only way to make software right is to find out what is wrong with it :)
Memory in C++ is a leaky abstraction .

ejolson
Posts: 5422
Joined: Tue Mar 18, 2014 11:47 am

Re: Project Digital Apocalypse Not Now

Sun Jul 14, 2019 7:34 pm

Heater wrote:
Sun Jul 14, 2019 7:24 pm
ejolson,
Is that the year you graduated?
Nope. The summer before I got into uni.
Right. So what happened in 1976 that allowed the digital overlords to take over?

Heater
Posts: 15997
Joined: Tue Jul 17, 2012 3:02 pm

Re: Project Digital Apocalypse Not Now

Sun Jul 14, 2019 7:50 pm

That is going to take some explaining.

Let me sleep on it so that I can express it concisely.
Memory in C++ is a leaky abstraction .

Heater
Posts: 15997
Joined: Tue Jul 17, 2012 3:02 pm

Re: Project Digital Apocalypse Not Now

Sun Jul 14, 2019 9:27 pm

Those with an interest in 8 bit computers and the digital apocalypse might like to watch this video to see how hopeless it is, or perhaps see a glimmer of hope if we make the effort now.

Creating a truly open and trustable mobile communications device: https://www.youtube.com/watch?v=KuNB4ocZDXA

As the guy there says "Full digital sovereignty"
Memory in C++ is a leaky abstraction .

Andyroo

Re: Project Digital Apocalypse Not Now

Mon Jul 15, 2019 12:35 am

ejolson wrote:
Sun Jul 14, 2019 7:34 pm
...
Right. So what happened in 1976 that allowed the digital overlords to take over?
Cray - 1 launched, CP/M came out, a little box by Apple :?:

Got it - the Queen sent an email surrendering the world via Viking II on Mars to our new overlords - hold on someone’s at the doooooooooooo
<transmitting correction>
Joke fellow humans - nothing happened that year NOTHING at all. Please carry on as normal.

User avatar
John_Spikowski
Posts: 1614
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: Project Digital Apocalypse Not Now

Tue Jul 16, 2019 4:06 am

How languages were created.

Until everyone agrees on a new standard, C will continue to be a foundation language. I don't see Linux written in anything else soon.

Our Ninja turtle heros.
Attachments
D_f_tJ1XsAAmec5.jpeg
D_f_tJ1XsAAmec5.jpeg (49.01 KiB) Viewed 871 times

Heater
Posts: 15997
Joined: Tue Jul 17, 2012 3:02 pm

Re: Project Digital Apocalypse Not Now

Tue Jul 16, 2019 5:07 am

ScriptBasic,
Our Ninja turtle heros.
That image characterizing programming language progress that is doing the rounds everywhere is the most ridiculous and stupid thing.

It's hard to imagine Java, Python and C# as "ninja" anything never mind turtles.

Rather they should be depicted as something that is a horribly mutated offspring of it's parent, immensely fat, and slow. Whilst the parent is still working out all day everyday.

I have no idea what popular fictional characters those might be. Perhaps we can find something.
Until everyone agrees on a new standard, C will continue to be a foundation language. I don't see Linux written in anything else soon.
Quite so.

Even if we all jumped on some new clean, safe, performant language today it would take three decades to get any operating system anyone started building with it to where Linux is today.

Of course in that fantasy future we need not recreate Linux at all. If all the worlds hardware makers would agree on common standards and/or provide opensource drivers in that new language we could probably get all the functionality we expect from Linux in something far smaller and only taking 10 or even 3 years to develop.

Dream on...

There has been talk of making use of some new cleaner, safer, language in parts of the kernel. Why not write a new kernel module in Rust or D or whatever?

Interesting idea but it would make a mess of the kernel, make building it harder, divide the developer efforts. As you say people would not agree on what new language so we would soon end up with a dozen different languages required to build a kernel!

I don't see it working out well.

However...

I have sometimes pondered the idea of putting a Javascript engine into a kernel module. It would be pretty simple to wrap something like the JerryScript engine as a kernel module. One could open it like a file and write code to it to run. Sweet.

The main motivation to do this, apart from the challenge, would be to see the howls of protest and disgust when people find it on Hackaday and in a github repository.

I love to read the response from the kernel maintainers when I submit it for inclusion in the upstream kernel :)
Memory in C++ is a leaky abstraction .

User avatar
John_Spikowski
Posts: 1614
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: Project Digital Apocalypse Not Now

Tue Jul 16, 2019 5:19 am

Heater,

If you were to write a ScriptBasic extension module, what would it be?

Maybe a code challenge to create a ScriptBasic extension module rather than a GUI editor
editor would have attracted more interest.

Anyone have any experience writting a custom Scintilla lexer? I'm trying to dig up the source to Dave's ScriptBasic lexer he wrote.

Heater
Posts: 15997
Joined: Tue Jul 17, 2012 3:02 pm

Re: Project Digital Apocalypse Not Now

Tue Jul 16, 2019 5:36 am

ScriptBasic,

If I had to use ScriptBasic but I could make whatever extensions for it it I would create a wrapper for node.js.

Then I could write Javascript in that editor extension you have.

:)
Last edited by Heater on Tue Jul 16, 2019 5:40 am, edited 1 time in total.
Memory in C++ is a leaky abstraction .

Heater
Posts: 15997
Joined: Tue Jul 17, 2012 3:02 pm

Re: Project Digital Apocalypse Not Now

Tue Jul 16, 2019 5:40 am

ScriptBasic,
Anyone have any experience writting a custom Scintilla lexer? I'm trying to dig up the source to Dave's ScriptBasic lexer he wrote.
No but I know the guy that wrote SimpleIDE for the Parallax Propeller MCU which uses Scintilla for syntax highlighting their Spin language. Perhaps you can get inspiration from his code:

https://github.com/parallaxinc/SimpleIDE
Memory in C++ is a leaky abstraction .

User avatar
John_Spikowski
Posts: 1614
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: Project Digital Apocalypse Not Now

Tue Jul 16, 2019 6:21 am

If I had to use ScriptBasic but I could make whatever extensions for it it I would create a wrapper for node.js.
If I can get the V7 JavaScript extension module running on Raspain, would you take an interest in it?

ScriptBasic JavaScript Extension Module

Heater
Posts: 15997
Joined: Tue Jul 17, 2012 3:02 pm

Re: Project Digital Apocalypse Not Now

Tue Jul 16, 2019 7:12 am

What do you mean "V7 JavaScript"?

Anything that uses javascript had better make use of node.js https://nodejs.org/en/

Which is under continuous development so it has better cater for installing new releases as they come along.
https://nodejs.org/en/download/releases/

Perhaps my wrapping Node Version Manager:
https://github.com/nvm-sh/nvm

A major feature of the node.js world is all the thousands of useful modules people have created for it so it had better support Node Package Manager (npm) automation. Luckily npm comes with the node.js installation.

Which in turn would make git integration very desirable, perhaps essential.

To be worth the effort the editor would have to provide all the JS syntax highlighting, linting, formatting that people expect.

All of which is a huge project, too much for me to even think about. And why do it in ScriptBasic when it can be done more easily in JS? And luckily already has been:
MS Visual Studio Code : https://code.visualstudio.com/
Atom: https://atom.io/

How about turning the idea around, make a node.js module so that people can use BASIC from their JS programs?

Or compile it all with Emscripten and wrap some JS around it so that people can edit and run ScriptBasic in their browsers?
Memory in C++ is a leaky abstraction .

User avatar
John_Spikowski
Posts: 1614
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: Project Digital Apocalypse Not Now

Tue Jul 16, 2019 7:24 am

You could embed ScriptBasic in Node with less lines of code than you have fingers.

Look at the source to the SBT extension module. Instead of executing the functions from ScriptBasic, call them from Node.

The example scripts I put together with the RPi distribution has an example of SBT use. If you search AllBasic for SBT you should find examples as well.

In a nutshell you're embedding SciptBasic as a thread based shared object.
Last edited by John_Spikowski on Tue Jul 16, 2019 7:46 am, edited 3 times in total.

Heater
Posts: 15997
Joined: Tue Jul 17, 2012 3:02 pm

Re: Project Digital Apocalypse Not Now

Tue Jul 16, 2019 7:31 am

I look forward to seeing those few lines when you post them. I will be sure to test it.
Memory in C++ is a leaky abstraction .

Return to “General programming discussion”