sableland / sable Goto Github PK
View Code? Open in Web Editor NEWJavaScript runtime Deno was meant to be.
License: MIT License
JavaScript runtime Deno was meant to be.
License: MIT License
We need to have some way of interacting with the web. If we implement this, we should get a huge boost in the amount of modules we can run. We should take a lot of inspiration from Deno here.
@lino-levan Please see: https://www.youtube.com/watch?v=5_oqWE9otaE -- at 1:15:00
I'll break this down into three categories. These are only stable APIs (according to the MDN definition of stable). I'll open a seperate issue for unstable APIs that might be nice to have in sable.
We have it
We kind of have it (partial support)
We want it
We don't want it
We need an opinionated formatter to make bueno
both usable and to follow through with it's vision.
setTimeout(() => {
queueMicrotask(() => {
setTimeout(() => {
console.log("should be called but isn't");
}, 0);
});
}, 0);
If there are no registered timers after a timer callback is finished running, but microtasks are enqueued that will register timers, those timers will not run. Or at least not until the next time a timer is registered.
This is caused by the fact that op_timers_sleep
is called immediately after the timer callback runs, and it sees there are no timers in the queue, so it returns null
immediately. However, since it's an async op, the code after the await will run after the currently scheduled microtasks, which can register new timers. And this isn't being taken into account.
We should add a linter to bueno
, preferably through oxc.
Importing a URL with no file extension (e.g. https://esm.sh/whatwg-fetch) results in the following error:
thread 'main' panicked at 'Failed extracting file extension: ()', bueno/loader.rs:46:26
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
This is due to bueno/loader.rs
checking for the file extension on both file imports and HTTP imports. This can be resolved by checking for a protocol in front of the import path (e.g. http
, https
, file://
, or ()
; no protocol so default to file://
, etc). This will allow us to check whether or not there's a Content-Type
, which would allow for extensionless imports and therefore allow imports without explicit file extensions.
This is probably on the scale of "very hard"
Dependent on oxc_linter
getting published at some point. Importing from Github gives weird module errors. We could fork it, but that doesn't sound fun to maintain.
We should support AoT compiled JS.
$ bueno snapshot mod.js
$ bueno run mod.snapshot
One of the core sets of APIs that must be available for Bueno to be useable are the file system APIs. This issue tracks all of the filesystem APIs we're missing.
readFile
- async read file and return uint8arrayreadFileSync
- sync version of abovereadTextFile
- async read text file and return uint8arrayreadTextFileSync
- sync version of abovewriteFile
- async write file form uint8arraywriteFileSync
- sync version of abovewriteTextFile
- async write text file form uint8arraywriteTextFileSync
- sync version of aboveWe'll edit this list as we complete some. We need to discuss our file API. How should we design it? What will our Bueno.fs.File
class (?) look like?
this list should be expanded upon on the fly
Sable.
fs
readFile
– read file and return Uint8Array
readTextFile
– read file and return string
writeFile
– write file using Uint8Array
writeTextFile
– write file using string
removeFile
- delete fileremoveDirectory
- delete directorycopyFile
- copy filecopyDirectory
- copy directorymoveFile
- move/rename filemoveDirectory
- move/rename directorymakeDirectory
- create a new directorymakeFile
- create a new filemakeTempDirectory
- create a new temporary directory in /tmp
makeTempFile
- create a new temp file in /tmp
watch
- create iterable which yields changes in file systemio
read
– read from resource id into given Uint8Array
write
– async write to resource id using Uint8Array
stdin
– interface for working with standard inputstdout
– interface for working with standard outputstderr
– interface for working with standard error outputtesting
test
- test runnerbench
- benchmark runnerWe want it
We don't want it
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.