Git Product home page Git Product logo

full-stack-hello's People

Contributors

hexrabbit avatar htyisabug avatar jheyuliu avatar jserv avatar mlouielu avatar pakls avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

full-stack-hello's Issues

Exception handling mechanism discussion

At the moment, DIV and MOD considers divide-by-zero (I'll call it as DBZ from now on) as unimplemented.

We are in need of an exception handling mechanism when DBZ happens.

I can think of a few ways now:

  1. Add a (typical) exception handling callback (like ISR) like general CPUs do.
  2. Add a global flag that can be set when DBZ happens and code can explicitly check the flag after a DIV or MOD operation is performed.

The considerations that I can think of by now. They are tradeoffs during most of the time.

A. Speed
B. VM Complexity
C. Support of higher level semantics, such as C++ Exception

The opcode impl hook design is inefficient

Current design about opcode implement hook is to hook the corresponding implement to each instruction in env->insts, which the insts is read from file.

Should it be hook on an opcode impl list, then each instruction only need to call from env->impl[opcode](...), this should be more efficient for memory usage and hooking stage.

Label support in assembly

Recently, @pakls contributed a series of conditional branch instructions which enables further translation from higher level languages to our virtual machine. However, lacking of labels prevents jump instructions from being efficiently used.

Thus, we expect that assembler can recognize labels as the indicators of open/close loop or deterministic location.

Test runner is not working with Python2

While executing test runner with Python2, I got the following error:

  File "tests/runner.py", line 38
    class TestRunner(unittest.TestCase, metaclass=TestRunnerMeta):
                                                 ^
SyntaxError: invalid syntax

Cc. @mlouielu

Latest version can't pass test suite

commit: 73432bf, can't pass the test suite:

FFF
======================================================================
FAIL: test_coverage (__main__.TestRunner)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/runner.py", line 38, in test
    self.assertEqual(got, expected)
AssertionError: b'' != b'42\n50\n150\n'

======================================================================
FAIL: test_halt (__main__.TestRunner)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/runner.py", line 38, in test
    self.assertEqual(got, expected)
AssertionError: b'' != b'42\n'

======================================================================
FAIL: test_hello (__main__.TestRunner)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/runner.py", line 38, in test
    self.assertEqual(got, expected)
AssertionError: b'' != b'Hello\n'

----------------------------------------------------------------------
Ran 3 tests in 0.001s

FAILED (failures=3)
make: *** [Makefile:36: test] Error 1

Make check didn't really check

Got:

➜  full-stack-hello git:(master) ✗ make check 
tests/hello.s pass

tests/test.s pass

Expect:

➜  full-stack-hello git:(master) ✗ make check
Hello
tests/hello.s pass

42
50
150
tests/test.s pass

ELF save/load support

Hi, All, I am implementing the support of this. :)

Currently, the instruction set implementation is host specific. That is, if current host is 64 bits, then the in VM and everything will be 64 bits, and vice versa.

Native code seamless integration

This is a naive idea at its infancy: Integrate this VM based code with native code.

Allowing them to invoke each other.

Some assumptions/limitations may have to be imposed to speed up the execution and data type conversion.

Space in string is not supported

Currently, only ^Hello can be printed. Need to support space character, such as

'Hello World', or "Hello World"

to be a real 'Hello World' full-stack demo.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.