-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inline includes and mark them as jsNode where necessary #612
Conversation
@@ -24,26 +24,26 @@ def console[R] { program: () => R / Console }: R = { | |||
|
|||
namespace js { | |||
|
|||
extern js """ | |||
extern jsNode """ | |||
const readline = require('node:readline'); | |||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specific to node js and doesn't work in the webbrowser, for now simply disable
extern pure def errorNumber(errno: Int): Int = | ||
js "errorNumber(${errno})" | ||
jsNode "errorNumber(${errno})" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using os
""" | ||
|
||
extern async def open(path: String, mode: Mode): Int = | ||
js "$effekt.callcc(callback => open(${path}, ${mode}, callback))" | ||
jsNode "$effekt.callcc(callback => open(${path}, ${mode}, callback))" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using fs
which is only available in node, but not web
aeff097
to
b393263
Compare
@@ -4,7 +4,7 @@ import bytes | |||
import io | |||
|
|||
namespace js { | |||
extern js """ | |||
extern jsNode """ | |||
const net = require('node:net'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node:net
is only available on node
@phischu I tried to establish the principle that each file only includes its own forward declarations. To this end, and to deduplicate the forward declaration of However, while this is a tiny function that just forwards and seems useless, semantically I think it makes sense to distinguish the two. |
We can merge this PR in my opinion, the moment CI passes. Merging this quickly is important, since it blocks #536. |
This ought to address #611