Hacker News new | ask | show | jobs
by kittiepryde 3769 days ago
It looks like a neat experiment (definitely cool though), but I imagine you could (eventually?) implement a scripting language like lua in it, and register your program's external commands the scripting language needs access to.
1 comments

Yeah, I have some specific goals to it. One is making it into a game platform. See a video of the start of that project: https://twitter.com/WetDesertRock/status/703300191512715264
What sort of graphics/audio interface do you expose to the program?

(The project is very cool! The instruction set reminds me a bit of the MIPS subset usually implemented in uni courses.)

Oh, and I forgot to answer your question.

I haven't decided on audio. It might be a set of sys calls that manipulate oscillators. The graphics interface is quite literally just manipulating the program memory. You can see the registers in the lower left corner of the video I linked.

Yeah, I used my limited knowledge of x86 and some research into other ISA's (such as MIPS) to give me some ideas.
But do you need the VM for something specific, is it part of some philosophical/aesthetic guideline, or is it just something fun to do?
I've wanted to make a language where the memory and the graphics output were interlinked. Meaning your memory was always visible and you had to balance memory usage and graphics usage. For some reason it took me too long to realize I needed to make a VM to make that a reality. Because of that goal, I decided to design the VM around a simplistic goal of having all program memory in one block. While this isn't realistic (a real machine wouldn't have its registers stored in the same memory as stored memory), I decided I didn't care. So in the end, there was one core idea I wanted to play with, but I also wanted to teach myself more about ISA design and explore that area more.
I still dont understand why it requires a VM. What do you mean by 'interlinked' and 'always visible'. What does C lack that means this would not be possible? Does 'balance memory usage and graphics usage' refer to designing for very small systems with only a few megabytes?
Yeah, you could do it in C. I just didn't want to. The other part was that I wanted to make a language. I didn't want to piggyback off of something else. I mean interlinked is that your memory that you have to use for your application is also the memory that gets treated as a pixel buffer. So when you want to draw, you write directly to your pixel buffer. When I mean balancing memory usage and graphics usage I mean if you use too much memory, too much screens real-estate would be used.
He might meen GPU programming, which has separate processors and memory from the CPU.