Comments (6)
Yes I was thinking websockets. A nice web interface would be perfect and allow the VM to run without being tainted with mixed input from the debugger (reading stdin while debugging is essentially impossible since the last key in the buffer is always the 'step' key.
Fancy graphics is a plus, but I'm all about small incremental developments. So the first thing would just be to be able to display the current kind of debugger output in a web browser, to be able to take debug input and send it to back to the VM, and breakpoints.
from 16bitjs.
So, if I am correct, this is an in-browser websockets implementation discussed in here. Perhaps, something like node-inspector
? https://github.com/node-inspector/node-inspector/
And, how about some fancy ANSI graphics and so on? :)
from 16bitjs.
Fancy graphics sounded like the logical next step after building sockets
I will start with a React version of the current debugger UI. Previously written a simple stack here which I believe fits perfectly in this scenario. This has websockets and also uses multiplex-rpc along with it. There could be other alternatives to multiplex-rpc
these days, but this is good to go for starters I believe.
Do you want to remove the current debugger altogether? Having a debugger that works in the terminal sounds really cool. But I am not really sure if every VM should have one. Maybe we can separate those two into, debugger
and inspector
(which depends on the debugger
) and investigate further on how this could be improved also in the terminal.
from 16bitjs.
Well the way I see it, what would be the most flexible option is to basically establish a debugger API that can be exposed from the VM when run in debug mode. Basically just a socket server that can send and receive standardised messages and act on those. Sent messages will be things like the state of the vm, and received will be things like set breakpoint, remove breakpoint, step etc.
This way it's frontend agnostic - it's easy to to create a react, angular, terminal, or whatever. So to answer your question, I think the API definition and socket server can live within this project and any frontend can be separated.
from 16bitjs.
Commit d92bec8 adds a simple test for encoding and decoding snapshots.
I had to sandbox it using vm
to prevent the changes from being permanent. Using browserify
seemed very convenient for this task, since 16bitjs
doesn't have many dependencies (none) and this should also work in browser as well (decode-snapshot
), so it is also a free test.
However, I didn't like this
1- Do not use singletons, no module level caching and such.
2- Or, we can have a way to "reset" everything, but still it is not as good as removing singletons.
I thought memory
, stack
and registers
are the only things that needed to be reset, but apparently they are not, or maybe I did wrong filling them with zeroes. But since they are module-level, there is also no way to re-instantiate them.
from 16bitjs.
@tetsuo I checked it out briefly this morning, looking great. It's strange that zeroing the memory and registers didn't work - there really isn't anything that should prevent that method of reset from working. Perhaps we can take a quick look today? If we can get that to work then we can wire a reset function directly into the cpu object. As for removing singletons, this should be really straightforward actually, since they're all required once and passed as arguments.
from 16bitjs.
Related Issues (20)
- LDV16 B, value probably doesn't work HOT 1
- LICENCE isn't filled in HOT 2
- Replace JMP with a CMP instruction, and rename JMR to JMP HOT 11
- Extend LDR with offset mode HOT 4
- LDV - a better way to deal with 16-bit immediate value HOT 7
- Security issue: code execution when assembling files HOT 2
- Merge SYS, HLT and RET since they no arguments HOT 4
- Trouble to use "node src/assembler" HOT 2
- MOV - using the upper 8 bits to store a sign-extended immediate as an addend HOT 2
- Add optional offset to LDR HOT 1
- Rename LDM to STA HOT 1
- Rename LDP to STR with an optional 8 bit offset HOT 6
- LDA/LDM/LDR/LDP become LDA/STA/LDR/STR HOT 7
- Refactor JLT to JCP (Jump ComPare) HOT 1
- An example (but incomplete) of ISA using almost the same rules of 16bitjs
- Convert to signed 16 but integer format HOT 1
- SWAP - this pseudo can be done through 3 XORs HOT 10
- STACK - some RISC CPUs don't have a PUSH and POP instructions
- Missing ESLint configuration HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 16bitjs.