PicoBlaze Simulator in JavaScript

Off-topic talk on music, art, literature, games and forum games.
teo123
Master of the Forum
Posts: 1449
Joined: Tue Oct 27, 2015 3:46 pm
Diet: Vegan

PicoBlaze Simulator in JavaScript

Post by teo123 »

As a part of a school project, I've been developing my PicoBlaze Simulator in JavaScript. What do you think about it? How can I make it better in a way that isn't too difficult to program?
TelepathyConspiracy
Junior Member
Posts: 82
Joined: Thu Dec 22, 2022 3:50 pm
Diet: Vegan

Re: PicoBlaze Simulator in JavaScript

Post by TelepathyConspiracy »

Hi, interested in the source code

Working on a very rough draft of a direct source single page JavaScript ecosystem... Lots of evil is sorta derailing my productivity right now, code broke a few times and of course my old projects aren't there yet...

Let's collaborate
teo123
Master of the Forum
Posts: 1449
Joined: Tue Oct 27, 2015 3:46 pm
Diet: Vegan

Re: PicoBlaze Simulator in JavaScript

Post by teo123 »

TelepathyConspiracy wrote:Hi, interested in the source code
Well, you can see it by pressing CTRL-U ("View Source"), it is not minified. You can also see it here: https://github.com/FlatAssembler/PicoBl ... ator_in_JS
The biggest problem with it, I think, is that it is slow. People on AtheistForums have been trying to help me with speeding it up, but, thus far, to no avail: https://atheistforums.org/thread-61911- ... pid2112817
TelepathyConspiracy
Junior Member
Posts: 82
Joined: Thu Dec 22, 2022 3:50 pm
Diet: Vegan

Re: PicoBlaze Simulator in JavaScript

Post by TelepathyConspiracy »

I've always had a hard time putting together GitHub in my mind (not the only one), would you ever consider restructuring everything into a single page single file source code? Making our projects as easy as possible to learn and customize seems #1 for genuine collaboration... Very rough draft with bugs and incompleteness but you can see what I am referring to at goo.gl/Um2MAk
teo123
Master of the Forum
Posts: 1449
Joined: Tue Oct 27, 2015 3:46 pm
Diet: Vegan

Re: PicoBlaze Simulator in JavaScript

Post by teo123 »

TelepathyConspiracy wrote:would you ever consider restructuring everything into a single page single file source code?
No, because, in our Object Oriented Development classes, we were taught a single file should not be more than 100 lines of code. I have already broken that rule a few times, but putting all 3'000 lines of code in a single file would be extreme.

By the way, I did put everything in a single file in the 2'000-lines-of-code Arithmetic Expression Compiler I made in high school, so, if you like that, you can restore my project there. I have abandoned that project.
TelepathyConspiracy
Junior Member
Posts: 82
Joined: Thu Dec 22, 2022 3:50 pm
Diet: Vegan

Re: PicoBlaze Simulator in JavaScript

Post by TelepathyConspiracy »

Hi, there were these macheads guys years ago working on a OS written in JavaScript, I absolutely love that idea, not sure why else I would ever be interested in writing assembly code... Maybe you're working on something else? Doing absolutely everything in JavaScript sounds awesome, hilarious how the chrome API is sorta everything but a few core system functions...

https://www.youtube.com/watch?v=f7aRZN5wiHk
teo123
Master of the Forum
Posts: 1449
Joined: Tue Oct 27, 2015 3:46 pm
Diet: Vegan

Re: PicoBlaze Simulator in JavaScript

Post by teo123 »

TelepathyConspiracy wrote: Thu Dec 29, 2022 3:27 pm Hi, there were these macheads guys years ago working on a OS written in JavaScript, I absolutely love that idea, not sure why else I would ever be interested in writing assembly code... Maybe you're working on something else? Doing absolutely everything in JavaScript sounds awesome, hilarious how the chrome API is sorta everything but a few core system functions...

https://www.youtube.com/watch?v=f7aRZN5wiHk
Well, there have been some ideas of writing an OS in JavaScript.
As far as I know, Aaron OS is one such project, which is basically an OS running on top of a Chromium-based browser. It does things such as memory management, power management, and so on, all while running on top of a browser. It also supports multi-tasking, and it has a few programs you can run on it, all inside a browser.
Duktape JavaScript engine can also be run with minimal OS being present. It relies on very few things from the C library. So, it can perhaps be used to write most of the OS in JavaScript. I used Duktape in my ArithmeticExpressionCompiler, to do some low-level stuff that JavaScript does not support (such as file management) in C.
But, as far as I understand it, experienced programmers hate JavaScript. So much so that probably nobody capable of writing a good OS will be willing to do that in JavaScript. That's why, when targetting WebAssembly, I have rewritten my compiler from JavaScript to C++, rather than continuing working in JavaScript.
I don't think I will ever be writing an OS. I simply don't have an idea of what a good OS would look like. I have some ideas of what a good programming language would look like, but I have no idea what a good OS would look like.
I have made a few YouTube videos about my research of the compiler theory, the most recent one being this:
https://youtu.be/Br6Zh3Rczig
teo123
Master of the Forum
Posts: 1449
Joined: Tue Oct 27, 2015 3:46 pm
Diet: Vegan

Re: PicoBlaze Simulator in JavaScript

Post by teo123 »

Hi, @TelepathyConspiracy! I know you know some JavaScript. So, can you help me with the problems I have with the syntax highlighter of assembly in my PicoBlaze Simulator? https://www.reddit.com/r/PicoBlaze/comm ... edium=mweb
Thanks in advance!
TelepathyConspiracy
Junior Member
Posts: 82
Joined: Thu Dec 22, 2022 3:50 pm
Diet: Vegan

Re: PicoBlaze Simulator in JavaScript

Post by TelepathyConspiracy »

Link?
teo123
Master of the Forum
Posts: 1449
Joined: Tue Oct 27, 2015 3:46 pm
Diet: Vegan

Re: PicoBlaze Simulator in JavaScript

Post by teo123 »

TelepathyConspiracy wrote: Tue Aug 01, 2023 8:45 pm Link?
Link to what? My PicoBlaze Simulator? It is here: https://flatassembler.github.io/PicoBla ... Blaze.html
There are, like I've said on Reddit, three problems with my syntax highlighter, the most critical one being that the syntax highlighter inserts a semi-colon `;` after the characters `<`, `>` and `&`, making the programs that use those operators syntactically invalid (that is, it used to before I added the check and the error message in case somebody tries to highlight a program containing those characters). I mentioned two other problems on Reddit, but they are less important.
Post Reply