Skip to content
Discussion options

You must be logged in to vote

Yes, it compiles with tslang (tested with v0.0-pre-alpha120 on Windows) after a few small changes:

  1. node:fs is not available, so SystemIO uses the default library's stdio functions, which take a position in the array:
    • stdio_read is fread on stdin. It waits until it has len bytes or stdin ends, so it suits this program, which always asks for an exact number of bytes.
    • stdio_write_bytes(fd, ...) takes 1 for stdout and 2 for stderr. Both put the stream in binary mode on Windows.
    • view.__elementRef(offset) gives the address of an element, so reads and writes can start at an offset (a Uint8Array here is not a view over an ArrayBuffer).
  2. process.exit(1) becomes exit(1), with declare function ex…

Replies: 11 comments 12 replies

Comment options

You must be logged in to vote
1 reply
@ASDAlexander77
Comment options

Comment options

You must be logged in to vote
1 reply
@ASDAlexander77
Comment options

Comment options

You must be logged in to vote
1 reply
@ASDAlexander77
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@ASDAlexander77
Comment options

Answer selected by guest271314
@guest271314
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ASDAlexander77
Comment options

Comment options

You must be logged in to vote
4 replies
@guest271314
Comment options

@ASDAlexander77
Comment options

@guest271314
Comment options

@guest271314
Comment options

Comment options

You must be logged in to vote
2 replies
@ASDAlexander77
Comment options

@guest271314
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants