l0n0lc 0.9.7__tar.gz → 0.10.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: l0n0lc
3
- Version: 0.9.7
3
+ Version: 0.10.0
4
4
  Summary: 一个将python函数翻译为c++函数并运行的jit编译器
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Requires-Python: >=3.10
@@ -14,12 +14,55 @@ Dynamic: license-file
14
14
  ```
15
15
  pip install l0n0lc
16
16
  ```
17
- ## 2. hello_world.py
17
+
18
+ ## 2. 测试可执行.py
18
19
  ```python
19
20
  import l0n0lc as lc
20
- import math
21
+ import subprocess
22
+
23
+
24
+ @lc.映射函数(print, ['<iostream>'])
25
+ def cpp_cout(*args):
26
+ code = f'std::cout'
27
+ for arg in args:
28
+ code += f'<< {lc.toCString(arg)} << " "'
29
+ code += '<< std::endl;'
30
+ return code
31
+
32
+
33
+ @lc.映射类型('int')
34
+ class int32_t:
35
+ def __init__(self, v) -> None:
36
+ pass
37
+
38
+
39
+ @lc.映射类型('char**')
40
+ class charpp:
41
+ def __getitem__(self, key):
42
+ pass
43
+
44
+
45
+ 编译为可执行文件文件名 = '测试可执行文件'
46
+
47
+
48
+ @lc.jit(每次运行都重新编译=True, 编译为可执行文件文件名=编译为可执行文件文件名)
49
+ def 可执行(argc: int32_t, argv: charpp) -> int32_t:
50
+ for i in range(argc): # type: ignore
51
+ print(argv[i])
52
+ print('Hello World')
53
+ return int32_t(0)
21
54
 
22
55
 
56
+ subprocess.run([f'l0n0lcoutput/{编译为可执行文件文件名}', '参数1', '参数2'])
57
+
58
+ ```
59
+
60
+ ## 3. hello_world.py
61
+ ```python
62
+ import l0n0lc as lc
63
+ import math
64
+ import 测试可执行
65
+
23
66
  @lc.映射函数(math.ceil, ['<cmath>'])
24
67
  def cpp_ceil(v):
25
68
  return f'std::ceil({lc.toCString(v)});'
@@ -200,14 +243,19 @@ def test_add(a: int, b: int) -> int:
200
243
 
201
244
  print('结果:', test_add(1, 3))
202
245
 
246
+
203
247
  ```
204
248
 
205
- ## 3. 运行hello_world.py
249
+ ## 4. 运行hello_world.py
206
250
  ```
207
251
  uv run tests/hello_world.py
208
252
  # 输入: b'1\n2\n100\n101\n'
209
253
  ```
210
254
  ```bash
255
+ l0n0lcoutput/测试可执行文件
256
+ 参数1
257
+ 参数2
258
+ Hello World
211
259
  输出map:
212
260
  c 3
213
261
  a 1
@@ -231,27 +279,53 @@ vv: 1
231
279
 
232
280
  ```
233
281
 
234
- ## 4. 查看输出文件
282
+ ## 5. 查看输出文件
235
283
  ```bash
236
284
  ls -al ./l0n0lcoutput
237
- total 136
238
- drwxr-xr-x 2 root root 4096 Sep 27 02:40 .
239
- drwxrwxrwx 11 1000 1000 4096 Sep 27 02:40 ..
240
- -rw-r--r-- 1 root root 1811 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.cpp
241
- -rw-r--r-- 1 root root 167 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.h
242
- -rwxr-xr-x 1 root root 23584 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.so
243
- -rw-r--r-- 1 root root 1531 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.cpp
244
- -rw-r--r-- 1 root root 398 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.h
245
- -rwxr-xr-x 1 root root 40408 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.so
246
- -rw-r--r-- 1 root root 155 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.cpp
247
- -rw-r--r-- 1 root root 106 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.h
248
- -rwxr-xr-x 1 root root 15648 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.so
249
- -rw-r--r-- 1 root root 219 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.cpp
250
- -rw-r--r-- 1 root root 164 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.h
251
- -rwxr-xr-x 1 root root 15688 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.so
285
+ total 164
286
+ drwxr-xr-x 2 root root 4096 Oct 16 01:39 .
287
+ drwxrwxrwx 11 1000 1000 4096 Oct 16 01:39 ..
288
+ -rw-r--r-- 1 root root 298 Oct 16 01:39 6cbfb68e317eace4_测试可执行.py_可执行_@d82ed7910ac3268c.cpp
289
+ -rw-r--r-- 1 root root 128 Oct 16 01:39 6cbfb68e317eace4_测试可执行.py_可执行_@d82ed7910ac3268c.h
290
+ -rw-r--r-- 1 root root 1811 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.cpp
291
+ -rw-r--r-- 1 root root 167 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.h
292
+ -rwxr-xr-x 1 root root 23584 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.so
293
+ -rw-r--r-- 1 root root 1531 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.cpp
294
+ -rw-r--r-- 1 root root 398 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.h
295
+ -rwxr-xr-x 1 root root 40408 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.so
296
+ -rw-r--r-- 1 root root 155 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.cpp
297
+ -rw-r--r-- 1 root root 106 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.h
298
+ -rwxr-xr-x 1 root root 15648 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.so
299
+ -rw-r--r-- 1 root root 219 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.cpp
300
+ -rw-r--r-- 1 root root 164 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.h
301
+ -rwxr-xr-x 1 root root 15688 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.so
302
+ -rwxr-xr-x 1 root root 17248 Oct 16 01:39 测试可执行文件
303
+
304
+ ```
305
+ ## 6. 6cbfb68e317eace4_测试可执行.py_可执行_@d82ed7910ac3268c.cpp
306
+ ```c++
307
+ #include "6cbfb68e317eace4_测试可执行.py_可执行_@d82ed7910ac3268c.h"
308
+ extern "C" int /*可执行*/ main (int argc, char** argv)
309
+ {
310
+ for (int64_t i = 0; i < argc; ++i)
311
+ {
312
+ std::cout<< argv[i] << " "<< std::endl;;
313
+ }
252
314
 
315
+ std::cout<< u8"Hello World" << " "<< std::endl;;
316
+ return int(0);
317
+ }
318
+
319
+ ```
320
+ ## 7. 6cbfb68e317eace4_测试可执行.py_可执行_@d82ed7910ac3268c.h
321
+ ```c++
322
+ #pragma once
323
+ #include <cstdint>
324
+ #include <iostream>
325
+ #include <string>
326
+ extern "C" int /*可执行*/ main (int argc, char** argv);
253
327
  ```
254
- ## 5. c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.cpp
328
+ ## 8. c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.cpp
255
329
  ```c++
256
330
  #include "c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.h"
257
331
  extern "C" int64_t jit_all_ops (int64_t a, int64_t b)
@@ -348,7 +422,7 @@ extern "C" int64_t jit_all_ops (int64_t a, int64_t b)
348
422
  }
349
423
 
350
424
  ```
351
- ## 6. c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.h
425
+ ## 9. c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.h
352
426
  ```c++
353
427
  #pragma once
354
428
  #include <cstdint>
@@ -358,7 +432,7 @@ extern "C" int64_t jit_all_ops (int64_t a, int64_t b)
358
432
  #include <vector>
359
433
  extern "C" int64_t jit_all_ops (int64_t a, int64_t b);
360
434
  ```
361
- ## 7. c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.cpp
435
+ ## 10. c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.cpp
362
436
  ```c++
363
437
  #include "c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.h"
364
438
  extern "C" int64_t test_add (int64_t a, int64_t b)
@@ -423,7 +497,7 @@ extern "C" int64_t test_add (int64_t a, int64_t b)
423
497
  }
424
498
 
425
499
  ```
426
- ## 8. c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.h
500
+ ## 11. c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.h
427
501
  ```c++
428
502
  #pragma once
429
503
  #include "c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.h"
@@ -436,7 +510,7 @@ extern "C" int64_t test_add (int64_t a, int64_t b)
436
510
  #include <unordered_map>
437
511
  extern "C" int64_t test_add (int64_t a, int64_t b);
438
512
  ```
439
- ## 9. c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.cpp
513
+ ## 12. c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.cpp
440
514
  ```c++
441
515
  #include "c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.h"
442
516
  extern "C" int64_t test_other_fn (int64_t a, int64_t b)
@@ -445,14 +519,14 @@ extern "C" int64_t test_other_fn (int64_t a, int64_t b)
445
519
  }
446
520
 
447
521
  ```
448
- ## 10. c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.h
522
+ ## 13. c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.h
449
523
  ```c++
450
524
  #pragma once
451
525
  #include <cstdint>
452
526
  #include <string>
453
527
  extern "C" int64_t test_other_fn (int64_t a, int64_t b);
454
528
  ```
455
- ## 11. c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.cpp
529
+ ## 14. c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.cpp
456
530
  ```c++
457
531
  #include "c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.h"
458
532
  extern "C" int64_t /*test编译的函数*/ function_74657374e7bc96e8af91e79a84e587bde695b0 (int64_t a, int64_t b)
@@ -461,7 +535,7 @@ extern "C" int64_t /*test编译的函数*/ function_74657374e7bc96e8af91e79a84e5
461
535
  }
462
536
 
463
537
  ```
464
- ## 12. c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.h
538
+ ## 15. c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.h
465
539
  ```c++
466
540
  #pragma once
467
541
  #include <cstdint>
@@ -4,12 +4,55 @@
4
4
  ```
5
5
  pip install l0n0lc
6
6
  ```
7
- ## 2. hello_world.py
7
+
8
+ ## 2. 测试可执行.py
8
9
  ```python
9
10
  import l0n0lc as lc
10
- import math
11
+ import subprocess
12
+
13
+
14
+ @lc.映射函数(print, ['<iostream>'])
15
+ def cpp_cout(*args):
16
+ code = f'std::cout'
17
+ for arg in args:
18
+ code += f'<< {lc.toCString(arg)} << " "'
19
+ code += '<< std::endl;'
20
+ return code
21
+
22
+
23
+ @lc.映射类型('int')
24
+ class int32_t:
25
+ def __init__(self, v) -> None:
26
+ pass
27
+
28
+
29
+ @lc.映射类型('char**')
30
+ class charpp:
31
+ def __getitem__(self, key):
32
+ pass
33
+
34
+
35
+ 编译为可执行文件文件名 = '测试可执行文件'
36
+
37
+
38
+ @lc.jit(每次运行都重新编译=True, 编译为可执行文件文件名=编译为可执行文件文件名)
39
+ def 可执行(argc: int32_t, argv: charpp) -> int32_t:
40
+ for i in range(argc): # type: ignore
41
+ print(argv[i])
42
+ print('Hello World')
43
+ return int32_t(0)
11
44
 
12
45
 
46
+ subprocess.run([f'l0n0lcoutput/{编译为可执行文件文件名}', '参数1', '参数2'])
47
+
48
+ ```
49
+
50
+ ## 3. hello_world.py
51
+ ```python
52
+ import l0n0lc as lc
53
+ import math
54
+ import 测试可执行
55
+
13
56
  @lc.映射函数(math.ceil, ['<cmath>'])
14
57
  def cpp_ceil(v):
15
58
  return f'std::ceil({lc.toCString(v)});'
@@ -190,14 +233,19 @@ def test_add(a: int, b: int) -> int:
190
233
 
191
234
  print('结果:', test_add(1, 3))
192
235
 
236
+
193
237
  ```
194
238
 
195
- ## 3. 运行hello_world.py
239
+ ## 4. 运行hello_world.py
196
240
  ```
197
241
  uv run tests/hello_world.py
198
242
  # 输入: b'1\n2\n100\n101\n'
199
243
  ```
200
244
  ```bash
245
+ l0n0lcoutput/测试可执行文件
246
+ 参数1
247
+ 参数2
248
+ Hello World
201
249
  输出map:
202
250
  c 3
203
251
  a 1
@@ -221,27 +269,53 @@ vv: 1
221
269
 
222
270
  ```
223
271
 
224
- ## 4. 查看输出文件
272
+ ## 5. 查看输出文件
225
273
  ```bash
226
274
  ls -al ./l0n0lcoutput
227
- total 136
228
- drwxr-xr-x 2 root root 4096 Sep 27 02:40 .
229
- drwxrwxrwx 11 1000 1000 4096 Sep 27 02:40 ..
230
- -rw-r--r-- 1 root root 1811 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.cpp
231
- -rw-r--r-- 1 root root 167 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.h
232
- -rwxr-xr-x 1 root root 23584 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.so
233
- -rw-r--r-- 1 root root 1531 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.cpp
234
- -rw-r--r-- 1 root root 398 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.h
235
- -rwxr-xr-x 1 root root 40408 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.so
236
- -rw-r--r-- 1 root root 155 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.cpp
237
- -rw-r--r-- 1 root root 106 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.h
238
- -rwxr-xr-x 1 root root 15648 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.so
239
- -rw-r--r-- 1 root root 219 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.cpp
240
- -rw-r--r-- 1 root root 164 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.h
241
- -rwxr-xr-x 1 root root 15688 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.so
275
+ total 164
276
+ drwxr-xr-x 2 root root 4096 Oct 16 01:39 .
277
+ drwxrwxrwx 11 1000 1000 4096 Oct 16 01:39 ..
278
+ -rw-r--r-- 1 root root 298 Oct 16 01:39 6cbfb68e317eace4_测试可执行.py_可执行_@d82ed7910ac3268c.cpp
279
+ -rw-r--r-- 1 root root 128 Oct 16 01:39 6cbfb68e317eace4_测试可执行.py_可执行_@d82ed7910ac3268c.h
280
+ -rw-r--r-- 1 root root 1811 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.cpp
281
+ -rw-r--r-- 1 root root 167 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.h
282
+ -rwxr-xr-x 1 root root 23584 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.so
283
+ -rw-r--r-- 1 root root 1531 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.cpp
284
+ -rw-r--r-- 1 root root 398 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.h
285
+ -rwxr-xr-x 1 root root 40408 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.so
286
+ -rw-r--r-- 1 root root 155 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.cpp
287
+ -rw-r--r-- 1 root root 106 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.h
288
+ -rwxr-xr-x 1 root root 15648 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.so
289
+ -rw-r--r-- 1 root root 219 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.cpp
290
+ -rw-r--r-- 1 root root 164 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.h
291
+ -rwxr-xr-x 1 root root 15688 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.so
292
+ -rwxr-xr-x 1 root root 17248 Oct 16 01:39 测试可执行文件
293
+
294
+ ```
295
+ ## 6. 6cbfb68e317eace4_测试可执行.py_可执行_@d82ed7910ac3268c.cpp
296
+ ```c++
297
+ #include "6cbfb68e317eace4_测试可执行.py_可执行_@d82ed7910ac3268c.h"
298
+ extern "C" int /*可执行*/ main (int argc, char** argv)
299
+ {
300
+ for (int64_t i = 0; i < argc; ++i)
301
+ {
302
+ std::cout<< argv[i] << " "<< std::endl;;
303
+ }
242
304
 
305
+ std::cout<< u8"Hello World" << " "<< std::endl;;
306
+ return int(0);
307
+ }
308
+
309
+ ```
310
+ ## 7. 6cbfb68e317eace4_测试可执行.py_可执行_@d82ed7910ac3268c.h
311
+ ```c++
312
+ #pragma once
313
+ #include <cstdint>
314
+ #include <iostream>
315
+ #include <string>
316
+ extern "C" int /*可执行*/ main (int argc, char** argv);
243
317
  ```
244
- ## 5. c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.cpp
318
+ ## 8. c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.cpp
245
319
  ```c++
246
320
  #include "c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.h"
247
321
  extern "C" int64_t jit_all_ops (int64_t a, int64_t b)
@@ -338,7 +412,7 @@ extern "C" int64_t jit_all_ops (int64_t a, int64_t b)
338
412
  }
339
413
 
340
414
  ```
341
- ## 6. c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.h
415
+ ## 9. c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.h
342
416
  ```c++
343
417
  #pragma once
344
418
  #include <cstdint>
@@ -348,7 +422,7 @@ extern "C" int64_t jit_all_ops (int64_t a, int64_t b)
348
422
  #include <vector>
349
423
  extern "C" int64_t jit_all_ops (int64_t a, int64_t b);
350
424
  ```
351
- ## 7. c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.cpp
425
+ ## 10. c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.cpp
352
426
  ```c++
353
427
  #include "c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.h"
354
428
  extern "C" int64_t test_add (int64_t a, int64_t b)
@@ -413,7 +487,7 @@ extern "C" int64_t test_add (int64_t a, int64_t b)
413
487
  }
414
488
 
415
489
  ```
416
- ## 8. c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.h
490
+ ## 11. c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.h
417
491
  ```c++
418
492
  #pragma once
419
493
  #include "c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.h"
@@ -426,7 +500,7 @@ extern "C" int64_t test_add (int64_t a, int64_t b)
426
500
  #include <unordered_map>
427
501
  extern "C" int64_t test_add (int64_t a, int64_t b);
428
502
  ```
429
- ## 9. c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.cpp
503
+ ## 12. c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.cpp
430
504
  ```c++
431
505
  #include "c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.h"
432
506
  extern "C" int64_t test_other_fn (int64_t a, int64_t b)
@@ -435,14 +509,14 @@ extern "C" int64_t test_other_fn (int64_t a, int64_t b)
435
509
  }
436
510
 
437
511
  ```
438
- ## 10. c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.h
512
+ ## 13. c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.h
439
513
  ```c++
440
514
  #pragma once
441
515
  #include <cstdint>
442
516
  #include <string>
443
517
  extern "C" int64_t test_other_fn (int64_t a, int64_t b);
444
518
  ```
445
- ## 11. c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.cpp
519
+ ## 14. c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.cpp
446
520
  ```c++
447
521
  #include "c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.h"
448
522
  extern "C" int64_t /*test编译的函数*/ function_74657374e7bc96e8af91e79a84e587bde695b0 (int64_t a, int64_t b)
@@ -451,7 +525,7 @@ extern "C" int64_t /*test编译的函数*/ function_74657374e7bc96e8af91e79a84e5
451
525
  }
452
526
 
453
527
  ```
454
- ## 12. c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.h
528
+ ## 15. c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.h
455
529
  ```c++
456
530
  #pragma once
457
531
  #include <cstdint>
@@ -1,5 +1,5 @@
1
1
  from typing import Union, List, get_origin, get_args
2
- from .通用 import 生成变量Id, toCString
2
+ from .通用 import 生成变量Id, toCString, 通用信息
3
3
  import ctypes
4
4
 
5
5
 
@@ -54,6 +54,11 @@ def py类型转ctypes类型(类型):
54
54
  ret = 执行额外函数(额外py转ctypes函数, 类型)
55
55
  if ret is not None:
56
56
  return ret
57
+
58
+ ret = 通用信息.类型映射表.get(类型)
59
+ if ret is not None:
60
+ return ret.对应的ctypes类型
61
+
57
62
  return py2ctypes映射表.get(类型)
58
63
 
59
64
 
@@ -72,6 +77,10 @@ def py类型转c类型(类型):
72
77
  if ret is not None:
73
78
  return ret
74
79
 
80
+ ret = 通用信息.类型映射表.get(类型)
81
+ if ret is not None:
82
+ return ret.目标类型
83
+
75
84
  # 基础类型
76
85
  ret = py2c类型映射表.get(类型)
77
86
  if ret is not None:
@@ -82,9 +82,10 @@ class c布尔:
82
82
 
83
83
 
84
84
  class py2cpp编译器(ast.NodeVisitor):
85
- def __init__(self, 被编译的函数: Callable, c编译器) -> None:
85
+ def __init__(self, 被编译的函数: Callable, c编译器, 编译为可执行文件文件名: str | None = None) -> None:
86
86
  self.被编译的函数 = 被编译的函数
87
87
  self.c编译器: cpp编译器 = c编译器
88
+ self.编译为可执行文件文件名 = 编译为可执行文件文件名
88
89
  self.源代码 = inspect.getsource(被编译的函数)
89
90
  self.代码哈希值 = hashlib.blake2s(
90
91
  self.源代码.encode(), digest_size=8).hexdigest()
@@ -109,10 +110,13 @@ class py2cpp编译器(ast.NodeVisitor):
109
110
 
110
111
  # 保存函数名
111
112
  self.函数名 = 被编译的函数.__name__
112
- if 有非英文变量字符(self.函数名):
113
- self.c函数名 = f'function_{self.函数名.encode().hex()}'
113
+ if 编译为可执行文件文件名:
114
+ self.c函数名 = 'main'
114
115
  else:
115
- self.c函数名 = self.函数名
116
+ if 有非英文变量字符(self.函数名):
117
+ self.c函数名 = f'function_{self.函数名.encode().hex()}'
118
+ else:
119
+ self.c函数名 = self.函数名
116
120
  代码文件地址 = inspect.getfile(被编译的函数)
117
121
  文件名 = os.path.split(代码文件地址)[1]
118
122
  文件名hash = hashlib.blake2s(代码文件地址.encode(), digest_size=8).hexdigest()
@@ -131,7 +135,11 @@ class py2cpp编译器(ast.NodeVisitor):
131
135
  self.c编译器.库目录列表 = list(self.库目录)
132
136
  self.c编译器.链接库 = list(self.链接库列表)
133
137
  输出路径 = f'{通用信息.工作文件夹地址}/{self.获取库文件名()}'
134
- self.c编译器.编译为动态库(list(cpps), 输出路径=输出路径)
138
+ if self.编译为可执行文件文件名:
139
+ self.c编译器.添加编译选项("-O2")
140
+ self.c编译器.编译文件(list(cpps), 输出路径=输出路径)
141
+ else:
142
+ self.c编译器.编译为动态库(list(cpps), 输出路径=输出路径)
135
143
 
136
144
  def 添加c代码(self, 代码: str):
137
145
  self.代码序列.append(c代码(代码, self.当前上下文层级))
@@ -385,9 +393,10 @@ class py2cpp编译器(ast.NodeVisitor):
385
393
  if isinstance(node.returns, ast.Name):
386
394
  返回py类型 = self.获取值(node.returns)
387
395
  self.返回类型 = py类型转c类型(返回py类型)
388
- self.ctypes返回类型 = py类型转ctypes类型(返回py类型)
389
- if self.ctypes返回类型 is None:
390
- self.抛出代码异常(f'不支持的返回值类型{返回py类型}', node)
396
+ if not self.编译为可执行文件文件名:
397
+ self.ctypes返回类型 = py类型转ctypes类型(返回py类型)
398
+ if self.ctypes返回类型 is None:
399
+ self.抛出代码异常(f'不支持的返回值类型{返回py类型}', node)
391
400
  elif isinstance(node.returns, (tuple)):
392
401
  self.抛出代码异常('函数只能有一个返回值', node)
393
402
  else:
@@ -418,10 +427,11 @@ class py2cpp编译器(ast.NodeVisitor):
418
427
  self.抛出代码异常(f'不支持的类型{类型}', node)
419
428
  参数变量 = c变量(str(c类型), 参数名, True, 参数值)
420
429
  self.参数变量[参数名] = 参数变量
421
- ctypes类型 = py类型转ctypes类型(类型)
422
- if ctypes类型 is None:
423
- self.抛出代码异常(f'不支持的参数类型{类型}', node)
424
- self.ctypes类型.append(ctypes类型)
430
+ if not self.编译为可执行文件文件名:
431
+ ctypes类型 = py类型转ctypes类型(类型)
432
+ if ctypes类型 is None:
433
+ self.抛出代码异常(f'不支持的参数类型{类型}', node)
434
+ self.ctypes类型.append(ctypes类型)
425
435
  前置处理函数 = self.参数不同c类型前置处理函数.get(类型)
426
436
  if 前置处理函数 is not None:
427
437
  前置处理函数(self, 参数变量, node)
@@ -593,6 +603,8 @@ class py2cpp编译器(ast.NodeVisitor):
593
603
  return f'{self.获取无后缀文件名()}.cpp'
594
604
 
595
605
  def 获取库文件名(self):
606
+ if self.编译为可执行文件文件名:
607
+ return self.编译为可执行文件文件名
596
608
  return f'{self.获取无后缀文件名()}.so'
597
609
 
598
610
  def 获取cpp代码(self):
@@ -607,6 +619,10 @@ class py2cpp编译器(ast.NodeVisitor):
607
619
  if 文件名.startswith(self.文件前缀):
608
620
  文件路径 = os.path.join(通用信息.工作文件夹地址, 文件名)
609
621
  os.remove(文件路径)
622
+ if self.编译为可执行文件文件名:
623
+ 文件路径 = os.path.join(通用信息.工作文件夹地址, self.编译为可执行文件文件名)
624
+ if os.path.exists(文件路径):
625
+ os.remove(文件路径)
610
626
 
611
627
  def 将代码保存到文件(self):
612
628
  self.根据缀删除文件()
@@ -618,6 +634,8 @@ class py2cpp编译器(ast.NodeVisitor):
618
634
  fp.write(cpp代码)
619
635
 
620
636
  def 加载库(self):
637
+ if self.编译为可执行文件文件名:
638
+ return
621
639
  库地址 = f'{通用信息.工作文件夹地址}/{self.获取库文件名()}'
622
640
  self.目标库 = ctypes.CDLL(库地址)
623
641
  self.cpp函数 = self.目标库[self.c函数名]
@@ -625,14 +643,19 @@ class py2cpp编译器(ast.NodeVisitor):
625
643
  self.cpp函数.restype = self.ctypes返回类型
626
644
 
627
645
  def __call__(self, *args: Any, **kwds: Any) -> Any:
628
- return self.cpp函数(*args)
646
+ if self.编译为可执行文件文件名:
647
+ 库文件名 = self.获取库文件名()
648
+ 可执行文件地址 = f'{通用信息.工作文件夹地址}/{库文件名}'
649
+ raise Exception(f"请直接在命令行执行[{可执行文件地址}]")
650
+ else:
651
+ return self.cpp函数(*args)
629
652
 
630
653
 
631
- def jit(jit编译器类=None, cpp编译器类=None, 每次运行都重新编译: bool = False):
654
+ def jit(jit编译器类=None, cpp编译器类=None, 每次运行都重新编译: bool = False, 编译为可执行文件文件名: str | None = None):
632
655
  def 编译函数(fn: Callable):
633
656
  _c编译器类 = cpp编译器类 or cpp编译器
634
657
  _jit编译器类 = jit编译器类 or py2cpp编译器
635
- c语言函数编译器 = _jit编译器类(fn, _c编译器类())
658
+ c语言函数编译器 = _jit编译器类(fn, _c编译器类(), 编译为可执行文件文件名)
636
659
  库文件名 = c语言函数编译器.获取库文件名()
637
660
  if 每次运行都重新编译 or not os.path.exists(f'{通用信息.工作文件夹地址}/{库文件名}'):
638
661
  c语言函数编译器.编译()
@@ -73,11 +73,13 @@ class c类型映射:
73
73
  self, 目标类型,
74
74
  include目录: Optional[List[str]],
75
75
  库列表: Optional[List[str]],
76
- 库目录: Optional[List[str]]) -> None:
76
+ 库目录: Optional[List[str]],
77
+ 对应的ctypes类型=None) -> None:
77
78
  self.目标类型 = 目标类型
78
79
  self.include目录 = include目录 or []
79
80
  self.库列表 = 库列表 or []
80
81
  self.库目录 = 库目录 or []
82
+ self.对应的ctypes类型 = 对应的ctypes类型
81
83
 
82
84
  def __str__(self) -> str:
83
85
  return self.目标类型
@@ -132,9 +134,10 @@ def 映射函数(
132
134
  def 映射类型(被映射类型,
133
135
  include目录: Optional[List[str]] = None,
134
136
  链接库列表: Optional[List[str]] = None,
135
- 库目录列表: Optional[List[str]] = None):
137
+ 库目录列表: Optional[List[str]] = None,
138
+ 对应的ctypes类型=None):
136
139
  def 装饰器(映射目标):
137
- 通用信息.类型映射表[映射目标] = c类型映射(被映射类型, include目录, 链接库列表, 库目录列表)
140
+ 通用信息.类型映射表[映射目标] = c类型映射(被映射类型, include目录, 链接库列表, 库目录列表, 对应的ctypes类型)
138
141
  return 映射目标
139
142
  return 装饰器
140
143
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: l0n0lc
3
- Version: 0.9.7
3
+ Version: 0.10.0
4
4
  Summary: 一个将python函数翻译为c++函数并运行的jit编译器
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Requires-Python: >=3.10
@@ -14,12 +14,55 @@ Dynamic: license-file
14
14
  ```
15
15
  pip install l0n0lc
16
16
  ```
17
- ## 2. hello_world.py
17
+
18
+ ## 2. 测试可执行.py
18
19
  ```python
19
20
  import l0n0lc as lc
20
- import math
21
+ import subprocess
22
+
23
+
24
+ @lc.映射函数(print, ['<iostream>'])
25
+ def cpp_cout(*args):
26
+ code = f'std::cout'
27
+ for arg in args:
28
+ code += f'<< {lc.toCString(arg)} << " "'
29
+ code += '<< std::endl;'
30
+ return code
31
+
32
+
33
+ @lc.映射类型('int')
34
+ class int32_t:
35
+ def __init__(self, v) -> None:
36
+ pass
37
+
38
+
39
+ @lc.映射类型('char**')
40
+ class charpp:
41
+ def __getitem__(self, key):
42
+ pass
43
+
44
+
45
+ 编译为可执行文件文件名 = '测试可执行文件'
46
+
47
+
48
+ @lc.jit(每次运行都重新编译=True, 编译为可执行文件文件名=编译为可执行文件文件名)
49
+ def 可执行(argc: int32_t, argv: charpp) -> int32_t:
50
+ for i in range(argc): # type: ignore
51
+ print(argv[i])
52
+ print('Hello World')
53
+ return int32_t(0)
21
54
 
22
55
 
56
+ subprocess.run([f'l0n0lcoutput/{编译为可执行文件文件名}', '参数1', '参数2'])
57
+
58
+ ```
59
+
60
+ ## 3. hello_world.py
61
+ ```python
62
+ import l0n0lc as lc
63
+ import math
64
+ import 测试可执行
65
+
23
66
  @lc.映射函数(math.ceil, ['<cmath>'])
24
67
  def cpp_ceil(v):
25
68
  return f'std::ceil({lc.toCString(v)});'
@@ -200,14 +243,19 @@ def test_add(a: int, b: int) -> int:
200
243
 
201
244
  print('结果:', test_add(1, 3))
202
245
 
246
+
203
247
  ```
204
248
 
205
- ## 3. 运行hello_world.py
249
+ ## 4. 运行hello_world.py
206
250
  ```
207
251
  uv run tests/hello_world.py
208
252
  # 输入: b'1\n2\n100\n101\n'
209
253
  ```
210
254
  ```bash
255
+ l0n0lcoutput/测试可执行文件
256
+ 参数1
257
+ 参数2
258
+ Hello World
211
259
  输出map:
212
260
  c 3
213
261
  a 1
@@ -231,27 +279,53 @@ vv: 1
231
279
 
232
280
  ```
233
281
 
234
- ## 4. 查看输出文件
282
+ ## 5. 查看输出文件
235
283
  ```bash
236
284
  ls -al ./l0n0lcoutput
237
- total 136
238
- drwxr-xr-x 2 root root 4096 Sep 27 02:40 .
239
- drwxrwxrwx 11 1000 1000 4096 Sep 27 02:40 ..
240
- -rw-r--r-- 1 root root 1811 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.cpp
241
- -rw-r--r-- 1 root root 167 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.h
242
- -rwxr-xr-x 1 root root 23584 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.so
243
- -rw-r--r-- 1 root root 1531 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.cpp
244
- -rw-r--r-- 1 root root 398 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.h
245
- -rwxr-xr-x 1 root root 40408 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.so
246
- -rw-r--r-- 1 root root 155 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.cpp
247
- -rw-r--r-- 1 root root 106 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.h
248
- -rwxr-xr-x 1 root root 15648 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.so
249
- -rw-r--r-- 1 root root 219 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.cpp
250
- -rw-r--r-- 1 root root 164 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.h
251
- -rwxr-xr-x 1 root root 15688 Sep 27 02:40 c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.so
285
+ total 164
286
+ drwxr-xr-x 2 root root 4096 Oct 16 01:39 .
287
+ drwxrwxrwx 11 1000 1000 4096 Oct 16 01:39 ..
288
+ -rw-r--r-- 1 root root 298 Oct 16 01:39 6cbfb68e317eace4_测试可执行.py_可执行_@d82ed7910ac3268c.cpp
289
+ -rw-r--r-- 1 root root 128 Oct 16 01:39 6cbfb68e317eace4_测试可执行.py_可执行_@d82ed7910ac3268c.h
290
+ -rw-r--r-- 1 root root 1811 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.cpp
291
+ -rw-r--r-- 1 root root 167 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.h
292
+ -rwxr-xr-x 1 root root 23584 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.so
293
+ -rw-r--r-- 1 root root 1531 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.cpp
294
+ -rw-r--r-- 1 root root 398 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.h
295
+ -rwxr-xr-x 1 root root 40408 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.so
296
+ -rw-r--r-- 1 root root 155 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.cpp
297
+ -rw-r--r-- 1 root root 106 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.h
298
+ -rwxr-xr-x 1 root root 15648 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.so
299
+ -rw-r--r-- 1 root root 219 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.cpp
300
+ -rw-r--r-- 1 root root 164 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.h
301
+ -rwxr-xr-x 1 root root 15688 Oct 16 01:39 c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.so
302
+ -rwxr-xr-x 1 root root 17248 Oct 16 01:39 测试可执行文件
303
+
304
+ ```
305
+ ## 6. 6cbfb68e317eace4_测试可执行.py_可执行_@d82ed7910ac3268c.cpp
306
+ ```c++
307
+ #include "6cbfb68e317eace4_测试可执行.py_可执行_@d82ed7910ac3268c.h"
308
+ extern "C" int /*可执行*/ main (int argc, char** argv)
309
+ {
310
+ for (int64_t i = 0; i < argc; ++i)
311
+ {
312
+ std::cout<< argv[i] << " "<< std::endl;;
313
+ }
252
314
 
315
+ std::cout<< u8"Hello World" << " "<< std::endl;;
316
+ return int(0);
317
+ }
318
+
319
+ ```
320
+ ## 7. 6cbfb68e317eace4_测试可执行.py_可执行_@d82ed7910ac3268c.h
321
+ ```c++
322
+ #pragma once
323
+ #include <cstdint>
324
+ #include <iostream>
325
+ #include <string>
326
+ extern "C" int /*可执行*/ main (int argc, char** argv);
253
327
  ```
254
- ## 5. c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.cpp
328
+ ## 8. c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.cpp
255
329
  ```c++
256
330
  #include "c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.h"
257
331
  extern "C" int64_t jit_all_ops (int64_t a, int64_t b)
@@ -348,7 +422,7 @@ extern "C" int64_t jit_all_ops (int64_t a, int64_t b)
348
422
  }
349
423
 
350
424
  ```
351
- ## 6. c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.h
425
+ ## 9. c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.h
352
426
  ```c++
353
427
  #pragma once
354
428
  #include <cstdint>
@@ -358,7 +432,7 @@ extern "C" int64_t jit_all_ops (int64_t a, int64_t b)
358
432
  #include <vector>
359
433
  extern "C" int64_t jit_all_ops (int64_t a, int64_t b);
360
434
  ```
361
- ## 7. c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.cpp
435
+ ## 10. c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.cpp
362
436
  ```c++
363
437
  #include "c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.h"
364
438
  extern "C" int64_t test_add (int64_t a, int64_t b)
@@ -423,7 +497,7 @@ extern "C" int64_t test_add (int64_t a, int64_t b)
423
497
  }
424
498
 
425
499
  ```
426
- ## 8. c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.h
500
+ ## 11. c31f68e99ed4ce3c_hello_world.py_test_add_@469de6acaaabc570.h
427
501
  ```c++
428
502
  #pragma once
429
503
  #include "c31f68e99ed4ce3c_hello_world.py_jit_all_ops_@7801528c3d61baf7.h"
@@ -436,7 +510,7 @@ extern "C" int64_t test_add (int64_t a, int64_t b)
436
510
  #include <unordered_map>
437
511
  extern "C" int64_t test_add (int64_t a, int64_t b);
438
512
  ```
439
- ## 9. c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.cpp
513
+ ## 12. c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.cpp
440
514
  ```c++
441
515
  #include "c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.h"
442
516
  extern "C" int64_t test_other_fn (int64_t a, int64_t b)
@@ -445,14 +519,14 @@ extern "C" int64_t test_other_fn (int64_t a, int64_t b)
445
519
  }
446
520
 
447
521
  ```
448
- ## 10. c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.h
522
+ ## 13. c31f68e99ed4ce3c_hello_world.py_test_other_fn_@75fdd928ab58a8e3.h
449
523
  ```c++
450
524
  #pragma once
451
525
  #include <cstdint>
452
526
  #include <string>
453
527
  extern "C" int64_t test_other_fn (int64_t a, int64_t b);
454
528
  ```
455
- ## 11. c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.cpp
529
+ ## 14. c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.cpp
456
530
  ```c++
457
531
  #include "c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.h"
458
532
  extern "C" int64_t /*test编译的函数*/ function_74657374e7bc96e8af91e79a84e587bde695b0 (int64_t a, int64_t b)
@@ -461,7 +535,7 @@ extern "C" int64_t /*test编译的函数*/ function_74657374e7bc96e8af91e79a84e5
461
535
  }
462
536
 
463
537
  ```
464
- ## 12. c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.h
538
+ ## 15. c31f68e99ed4ce3c_hello_world.py_test编译的函数_@3bf4501e0408a243.h
465
539
  ```c++
466
540
  #pragma once
467
541
  #include <cstdint>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "l0n0lc"
3
- version = "0.9.7"
3
+ version = "0.10.0"
4
4
  description = "一个将python函数翻译为c++函数并运行的jit编译器"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
File without changes
File without changes
File without changes
File without changes
File without changes