functionalscript 0.0.459 → 0.0.460

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.
@@ -32,5 +32,5 @@ const run = f => {
32
32
  }
33
33
 
34
34
  run(cpp)
35
- run(cs)
36
35
  run(rust)
36
+ run(cs)
@@ -62,22 +62,20 @@ const output = platform => name => {
62
62
  }
63
63
 
64
64
  /** @type {Func} */
65
- const cpp = ({dirname, platform}) => {
66
- const extension = platform === 'win32' ? 'dll' : 'so'
67
- return {
68
- file: {
69
- name: `${dirname}/cpp/_result.hpp`,
70
- content: cppContent,
71
- },
72
- line: [
73
- flat([
74
- ['clang', '-shared', '-o', output(platform)('main')],
75
- flags(platform),
76
- [`${dirname}/cpp/main.cpp`]]
77
- ),
78
- ],
79
- }
80
- }
65
+ const cpp = ({dirname, platform}) => ({
66
+ file: {
67
+ name: `${dirname}/cpp/_result.hpp`,
68
+ content: cppContent,
69
+ },
70
+ line: [
71
+ flat([
72
+ ['clang', '-shared', '-o', output(platform)('main')],
73
+ flags(platform),
74
+ [`${dirname}/cpp/main.cpp`]]
75
+ ),
76
+ ],
77
+ })
78
+
81
79
 
82
80
  /** @type {Func} */
83
81
  const cs = ({dirname}) => ({
@@ -85,7 +83,8 @@ const cs = ({dirname}) => ({
85
83
  name: `${dirname}/cs/_result.cs`,
86
84
  content: csContent,
87
85
  },
88
- line: [['dotnet', 'build', `${dirname}/cs/cs.csproj`]],
86
+ line: [
87
+ ['dotnet', 'run', '--project', `${dirname}/cs/cs.csproj`]],
89
88
  })
90
89
 
91
90
  /** @type {Func} */
@@ -1,2 +1,8 @@
1
- // See https://aka.ms/new-console-template for more information
1
+ using System.Runtime.InteropServices;
2
+
3
+ [DllImport("testrust")]
4
+ static extern int get();
5
+
6
+ // See https://aka.ms/new-console-template for more information
2
7
  Console.WriteLine("Hello, World!");
8
+ Console.WriteLine(get());
@@ -8,4 +8,8 @@
8
8
  <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
9
9
  </PropertyGroup>
10
10
 
11
+ <ItemGroup>
12
+ <None Include="../../../target/debug/*testrust.*" CopyToOutputDirectory="PreserveNewest"/>
13
+ </ItemGroup>
14
+
11
15
  </Project>
@@ -41,3 +41,6 @@ impl _result::IMy::Ex for nanocom::CObject<My> {
41
41
  todo!()
42
42
  }
43
43
  }
44
+
45
+ #[no_mangle]
46
+ pub extern "C" fn get() -> i32 { 42 }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "functionalscript",
3
- "version": "0.0.459",
3
+ "version": "0.0.460",
4
4
  "description": "FunctionalScript is a functional subset of JavaScript",
5
5
  "main": "module.f.cjs",
6
6
  "scripts": {