Comments (5)
Sounds fun. That is indeed the case. I don't have a computer here at the moment, but adding new system calls involves roughly the following: the prim_sys() function of ovm.c is used to call system calls and other custom C-code. Add a new op there with some test code, make bin/vm, bin/vm fasl/ol.fasl and run (sys-prim 1 2 3) to call the C-code you added and verify it works. Next read the data you passed from owl side to C and verify it works. Small owl strings are actually the header followed by bytes of the string, but you need to make sure the strings are null-terminated before using them. c-string function can be used to do this automatically. After adding e.g. setenv library call to prim_sys, you could test it with something like (sys-prim (c-string "FOO") (c-string "42") null), and when it works, you can add definition of setenv to owl/sys.scm and export it, build owl with make, after which you have setenv at toplevel.
from owl.
It seems gihub ate my markup. All sys-prim calls above have your added opcode number as the first argument.
from owl.
The markup came through in the mail, that's sort of funny. Maybe you redirected some bash script they run :P
So it's just as I thought. Thanks for the quick response. I will try to implement some syscalls in a fork. Hopefully this time I'll stick with this project. Just not sure how deep the rabbit hole will get once I start poking with the C libcalls (haven't really used C before). If I manage to get something working I promise to rewrite your benchmark scripts :)
from owl.
Just noticed your description in IRC. The system calls are pretty well documented in the manual pages and typically have pretty simple semantics, so they're relatively easy to add to ovm.c. Feel free to ask if you get stuck somewhere or file bugs for the missing calls if some of them seem difficult.
You could use something like a tuple containing information about the data stream contents and some lazy list of data to define the streams between processes, e.g. (port->stream stdin) would give (tuple 'block-stream (port->block-stream stdin)), which you could then be converted to other more structured streams, which can then again be mapped back to block or byte streams and passed to external unix tools.
from owl.
Closing this as it isn't really an issue.
from owl.
Related Issues (20)
- with child processes, fix toggle_blocking(x, 1) on stdio HOT 7
- (owl eof) HOT 2
- there is no partial evaluation HOT 1
- Decide where to keep definition metadata
- Stream parsers should be able to resume on errors HOT 1
- Numbers are not disjoint from characters. HOT 1
- Signal handling HOT 1
- Repl syntax error handling
- Repl eval errors
- Less registers HOT 1
- Remove unused instructions from the VM HOT 2
- Quantified builds HOT 2
- increase data density on the heap HOT 2
- Macro environments and libraries HOT 1
- Undefined values when building on NetBSD HOT 1
- improve immediate loading efficiency HOT 3
- Consider getting rid of the bind instruction HOT 9
- clean-up the VM after the fasl 0.1.17 release HOT 1
- Look into Github alternatives HOT 8
- consider using dotted lists with bignum arithmetic 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 owl.