@shd101wyy/yo 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/README.md +40 -11
- package/out/cjs/index.cjs +14 -14
- package/out/cjs/yo-cli.cjs +453 -403
- package/out/esm/index.mjs +22 -22
- package/out/types/src/codegen/expressions/index.d.ts +0 -1
- package/out/types/src/codegen/utils/index.d.ts +5 -3
- package/out/types/src/env.d.ts +7 -6
- package/out/types/src/error.d.ts +6 -3
- package/out/types/src/evaluator/async/await-analysis-types.d.ts +1 -1
- package/out/types/src/evaluator/builtins/arc_fns.d.ts +20 -0
- package/out/types/src/evaluator/builtins/array_fns.d.ts +8 -0
- package/out/types/src/evaluator/builtins/type_fns.d.ts +2 -2
- package/out/types/src/evaluator/builtins/var_fns.d.ts +1 -1
- package/out/types/src/evaluator/calls/numeric_type.d.ts +4 -0
- package/out/types/src/evaluator/types/utils.d.ts +10 -10
- package/out/types/src/evaluator/utils.d.ts +1 -1
- package/out/types/src/expr.d.ts +9 -4
- package/out/types/src/types/creators.d.ts +1 -1
- package/out/types/src/types/definitions.d.ts +1 -1
- package/out/types/src/types/guards.d.ts +1 -1
- package/out/types/src/types/utils.d.ts +3 -2
- package/out/types/src/utils.d.ts +3 -1
- package/out/types/src/value.d.ts +4 -4
- package/out/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -2
- package/scripts/check-liburing.js +51 -39
- package/std/collections/array_list.yo +2 -2
- package/std/prelude.yo +272 -189
- package/out/types/src/codegen/expressions/array.d.ts +0 -4
- package/out/types/src/evaluator/utils/array-utils.d.ts +0 -15
- package/out/types/src/tests/codegen.test.d.ts +0 -1
- package/out/types/src/tests/module-manager.test.d.ts +0 -1
- package/out/types/src/tests/parser.test.d.ts +0 -1
- package/out/types/src/tests/sample.test.d.ts +0 -0
- package/out/types/src/tests/std.test.d.ts +0 -1
- package/std/monad.yo +0 -152
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/* eslint-disable no-undef */
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
4
|
|
|
3
|
-
const { execSync } = require(
|
|
4
|
-
const os = require(
|
|
5
|
-
const fs = require(
|
|
5
|
+
const { execSync } = require("child_process");
|
|
6
|
+
const os = require("os");
|
|
7
|
+
const fs = require("fs");
|
|
6
8
|
|
|
7
9
|
function checkLiburing() {
|
|
8
10
|
const platform = os.platform();
|
|
9
|
-
|
|
11
|
+
|
|
10
12
|
// Only check on Linux
|
|
11
|
-
if (platform !==
|
|
12
|
-
console.log(
|
|
13
|
+
if (platform !== "linux") {
|
|
14
|
+
console.log("ℹ️ Async I/O with io_uring is only supported on Linux.");
|
|
13
15
|
return;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
try {
|
|
17
19
|
// Try to find liburing using pkg-config
|
|
18
|
-
execSync(
|
|
19
|
-
console.log(
|
|
20
|
+
execSync("pkg-config --exists liburing", { stdio: "ignore" });
|
|
21
|
+
console.log("✅ liburing is installed and available.");
|
|
20
22
|
return;
|
|
21
23
|
} catch (error) {
|
|
22
24
|
// liburing not found via pkg-config, check if library exists
|
|
23
25
|
try {
|
|
24
|
-
execSync(
|
|
25
|
-
console.log(
|
|
26
|
+
execSync("ldconfig -p | grep liburing", { stdio: "ignore" });
|
|
27
|
+
console.log("✅ liburing library found.");
|
|
26
28
|
return;
|
|
27
29
|
} catch (e) {
|
|
28
30
|
// Not found at all
|
|
@@ -30,46 +32,56 @@ function checkLiburing() {
|
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
// liburing not found - show installation instructions
|
|
33
|
-
console.log(
|
|
34
|
-
console.log(
|
|
35
|
-
|
|
35
|
+
console.log("\n⚠️ liburing not found on your system.");
|
|
36
|
+
console.log("📦 Async I/O features require liburing to be installed.\n");
|
|
37
|
+
|
|
36
38
|
// Detect Linux distribution
|
|
37
|
-
let distro =
|
|
39
|
+
let distro = "";
|
|
38
40
|
try {
|
|
39
|
-
if (fs.existsSync(
|
|
40
|
-
const osRelease = fs.readFileSync(
|
|
41
|
-
const idLine = osRelease
|
|
41
|
+
if (fs.existsSync("/etc/os-release")) {
|
|
42
|
+
const osRelease = fs.readFileSync("/etc/os-release", "utf8");
|
|
43
|
+
const idLine = osRelease
|
|
44
|
+
.split("\n")
|
|
45
|
+
.find((line) => line.startsWith("ID="));
|
|
42
46
|
if (idLine) {
|
|
43
|
-
distro = idLine.split(
|
|
47
|
+
distro = idLine.split("=")[1].replace(/"/g, "").toLowerCase();
|
|
44
48
|
}
|
|
45
49
|
}
|
|
46
50
|
} catch (e) {
|
|
47
51
|
// Ignore errors
|
|
48
52
|
}
|
|
49
53
|
|
|
50
|
-
console.log(
|
|
51
|
-
|
|
52
|
-
if (distro.includes(
|
|
53
|
-
console.log(
|
|
54
|
-
console.log(
|
|
55
|
-
console.log(
|
|
56
|
-
} else if (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
console.log(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
console.log(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
console.log(
|
|
54
|
+
console.log("Installation instructions:");
|
|
55
|
+
|
|
56
|
+
if (distro.includes("ubuntu") || distro.includes("debian")) {
|
|
57
|
+
console.log(" Debian/Ubuntu:");
|
|
58
|
+
console.log(" sudo apt-get update");
|
|
59
|
+
console.log(" sudo apt-get install liburing-dev\n");
|
|
60
|
+
} else if (
|
|
61
|
+
distro.includes("fedora") ||
|
|
62
|
+
distro.includes("rhel") ||
|
|
63
|
+
distro.includes("centos")
|
|
64
|
+
) {
|
|
65
|
+
console.log(" Fedora/RHEL/CentOS:");
|
|
66
|
+
console.log(" sudo dnf install liburing-devel\n");
|
|
67
|
+
} else if (distro.includes("arch")) {
|
|
68
|
+
console.log(" Arch Linux:");
|
|
69
|
+
console.log(" sudo pacman -S liburing\n");
|
|
70
|
+
} else if (distro.includes("opensuse")) {
|
|
71
|
+
console.log(" openSUSE:");
|
|
72
|
+
console.log(" sudo zypper install liburing-devel\n");
|
|
73
|
+
} else if (distro.includes("alpine")) {
|
|
74
|
+
console.log(" Alpine Linux:");
|
|
75
|
+
console.log(" sudo apk add liburing-dev\n");
|
|
68
76
|
} else {
|
|
69
|
-
console.log(
|
|
77
|
+
console.log(
|
|
78
|
+
" Please install liburing-dev (or liburing-devel) for your distribution.\n"
|
|
79
|
+
);
|
|
70
80
|
}
|
|
71
|
-
|
|
72
|
-
console.log(
|
|
81
|
+
|
|
82
|
+
console.log(
|
|
83
|
+
"ℹ️ Yo will work without liburing, but async I/O operations will not be available."
|
|
84
|
+
);
|
|
73
85
|
// console.log(' You can compile with --allocator libc to avoid any io_uring dependencies.\n');
|
|
74
86
|
}
|
|
75
87
|
|
|
@@ -254,7 +254,7 @@ ArrayList :: (fn(compt(T): Type) -> compt(Type))
|
|
|
254
254
|
|
|
255
255
|
_free_elements :: ((fn(self : Self) -> unit)
|
|
256
256
|
cond(
|
|
257
|
-
Type.
|
|
257
|
+
Type.contains_rc_type(T) => {
|
|
258
258
|
i := usize(0);
|
|
259
259
|
base_ptr := self._ptr.unwrap();
|
|
260
260
|
while(i < self._length, i = (i + usize(1)), {
|
|
@@ -294,7 +294,7 @@ ArrayList :: (fn(compt(T): Type) -> compt(Type))
|
|
|
294
294
|
.Some(ptr) => {
|
|
295
295
|
// Free elements that will be removed if they contain ARC types
|
|
296
296
|
cond(
|
|
297
|
-
Type.
|
|
297
|
+
Type.contains_rc_type(T) => {
|
|
298
298
|
i := usize(0);
|
|
299
299
|
while(i < actual_count, i = (i + usize(1)), {
|
|
300
300
|
element_ptr := (ptr &+ (start + i));
|