codecin 6.3.1__tar.gz → 7.0.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.
- {codecin-6.3.1 → codecin-7.0.0}/CHANGELOG.md +262 -0
- {codecin-6.3.1 → codecin-7.0.0}/MANIFEST.in +1 -1
- {codecin-6.3.1/codecin.egg-info → codecin-7.0.0}/PKG-INFO +47 -16
- {codecin-6.3.1 → codecin-7.0.0}/README.md +46 -15
- {codecin-6.3.1 → codecin-7.0.0}/codecin/__init__.py +1 -1
- {codecin-6.3.1 → codecin-7.0.0}/codecin/aot.py +35 -17
- codecin-7.0.0/codecin/cbackend.py +2287 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/cin.py +321 -33
- {codecin-6.3.1 → codecin-7.0.0}/codecin/cli.py +20 -10
- {codecin-6.3.1 → codecin-7.0.0}/codecin/config.py +4 -3
- {codecin-6.3.1 → codecin-7.0.0}/codecin/cpu.py +5 -5
- {codecin-6.3.1 → codecin-7.0.0}/codecin/crom.py +37 -14
- {codecin-6.3.1 → codecin-7.0.0}/codecin/cvm.py +111 -42
- {codecin-6.3.1 → codecin-7.0.0}/codecin/disasm.py +4 -0
- codecin-7.0.0/codecin/lib/array/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/bigint/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/bits/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/bitset/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/codec/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/combin/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/conv/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/cppstd/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/cstd/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/csv/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/dp/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/ffi/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/fmt/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/frac/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/gostd/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/graph/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/gui/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/hash/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/heap/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/io/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/json/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/key/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/math/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/matrix/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/net/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/path/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/queue/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/rand/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/set/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/sort/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/stat/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/str/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/termux/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/test/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/text/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/time/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/token/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/tree/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/unionfind/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/validate/pic.toml +10 -0
- codecin-7.0.0/codecin/lib/vec/pic.toml +10 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/memory.py +1 -1
- {codecin-6.3.1 → codecin-7.0.0}/codecin/mkn.py +44 -7
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/keyboard_other.go +1 -1
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/version_gen.go +1 -1
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native.py +5 -1
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native_codegen.py +1 -1
- codecin-7.0.0/codecin/packaging/spec.py +193 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/packaging/vcs.py +13 -4
- {codecin-6.3.1 → codecin-7.0.0}/codecin/pic.py +602 -81
- {codecin-6.3.1 → codecin-7.0.0}/codecin/pic_registry.py +133 -4
- codecin-7.0.0/codecin/sdgcc.py +394 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/stdlib.py +22 -6
- codecin-7.0.0/codecin/toolchain.py +392 -0
- {codecin-6.3.1 → codecin-7.0.0/codecin.egg-info}/PKG-INFO +47 -16
- {codecin-6.3.1 → codecin-7.0.0}/codecin.egg-info/SOURCES.txt +91 -41
- {codecin-6.3.1 → codecin-7.0.0}/pyproject.toml +1 -1
- codecin-7.0.0/script/sync_stdlib_packages.py +194 -0
- {codecin-6.3.1 → codecin-7.0.0}/setup.py +41 -4
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_aggregate_and_const.py +1 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_all_libs_together.py +5 -3
- codecin-7.0.0/tests/test_cbackend.py +978 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_cin_new_features.py +1 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_cli.py +15 -5
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_features_importloc.py +1 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_ffi_net.py +2 -4
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_lib_bigint.py +1 -2
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_lib_bitset.py +1 -2
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_lib_codec.py +0 -2
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_lib_combin.py +1 -2
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_lib_csv.py +1 -2
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_lib_dp.py +1 -2
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_lib_fmt.py +1 -2
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_lib_frac.py +1 -2
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_lib_graph.py +1 -2
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_lib_heap.py +1 -2
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_lib_path.py +1 -2
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_lib_set.py +1 -2
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_lib_text.py +1 -2
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_lib_token.py +1 -2
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_lib_tree.py +1 -2
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_lib_unionfind.py +1 -2
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_libs.py +1 -1
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_libs_ext.py +1 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_native_lib_lookup.py +1 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_packaging.py +17 -1
- codecin-7.0.0/tests/test_sdgcc.py +187 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_sparse_memory.py +1 -2
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_struct_value_semantics.py +1 -0
- codecin-7.0.0/tests/test_toolchain.py +104 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_v620_cvm.py +3 -1
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_v620_mkn.py +1 -1
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_v620_pic.py +36 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_v620_pic_git.py +25 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_v620_pic_registry.py +45 -1
- codecin-7.0.0/tests/test_v640_pic_import.py +150 -0
- {codecin-6.3.1 → codecin-7.0.0}/LICENSE +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/assembler.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/console.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/environment.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/errors.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/isa.py +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/array/src}/array.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/bigint/src}/bigint.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/bits/src}/bits.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/bitset/src}/bitset.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/codec/src}/codec.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/combin/src}/combin.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/conv/src}/conv.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/cppstd/src}/cppstd.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/cstd/src}/cstd.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/csv/src}/csv.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/dp/src}/dp.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/ffi/src}/ffi.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/fmt/src}/fmt.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/frac/src}/frac.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/gostd/src}/gostd.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/graph/src}/graph.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/gui/src}/gui.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/hash/src}/hash.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/heap/src}/heap.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/io/src}/io.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/json/src}/json.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/key/src}/key.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/math/src}/math.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/matrix/src}/matrix.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/net/src}/net.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/path/src}/path.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/queue/src}/queue.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/rand/src}/rand.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/set/src}/set.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/sort/src}/sort.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/stat/src}/stat.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/str/src}/str.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/termux/src}/termux.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/test/src}/test.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/text/src}/text.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/time/src}/time.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/token/src}/token.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/tree/src}/tree.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/unionfind/src}/unionfind.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/validate/src}/validate.cin +0 -0
- {codecin-6.3.1/codecin/lib → codecin-7.0.0/codecin/lib/vec/src}/vec.cin +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/logger.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/aot/aot.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/aot/stub_main.go.txt +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/build.ps1 +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/build.sh +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/compiler/codegen.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/compiler/compile_test.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/compiler/parser.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/compiler/syscalls.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/compiler/tokenizer.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/compiler/types.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/args.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/audio.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/audio_other.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/audio_test.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/audio_windows.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/canvas.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/console_other.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/console_windows.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/crom.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/encode.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/engine_test.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/ffi_nocgo.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/ffi_registry.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/ffi_unix.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/ffi_windows.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/gui.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/gui_stub.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/gui_test.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/gui_windows.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/gui_x11.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/host_test.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/hostcrypto.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/hostdesktop.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/hostnet.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/isa_gen.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/keyboard.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/keyboard_stub.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/keyboard_termios_darwin.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/keyboard_termios_linux.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/keyboard_test.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/keyboard_windows.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/keyboard_windows_test.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/lineedit.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/lineedit_test.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/lineint_unix.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/lineint_windows.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/mem_other.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/mem_windows.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/native.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/netsock.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/ops_ext.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/stdin.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/stdin_other.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/stdin_windows.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/system.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/termux.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/vkb_darwin.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/vkb_linux.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/vkb_stub.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/engine/vm.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/go.mod +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/ir/ir.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/native/main.go +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/object.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/optimizer.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/packaging/__init__.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/packaging/archive.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/packaging/model.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/packaging/store.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/packaging/toml.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/pic_api.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/pic_login.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/registers.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/stats.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/toolkit.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin/version.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin.egg-info/dependency_links.txt +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin.egg-info/entry_points.txt +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin.egg-info/requires.txt +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/codecin.egg-info/top_level.txt +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/examples/args_demo.cin +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/examples/asm_constants.asm +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/examples/bitwise_builtins.cin +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/examples/control_flow.cin +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/examples/enum_range_for.cin +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/examples/gui_demo.cin +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/examples/literals_types.cin +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/examples/local_audio.cin +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/examples/modules_demo.cin +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/examples/stdlib_demo.cin +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/examples/system_interaction.cin +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/examples/terminal_cache_demo.cin +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/misc/vim/ftdetect/codecin.vim +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/misc/vim/syntax/cin.vim +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/misc/vim/syntax/codecinasm.vim +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/misc/vscode-cin/.vscodeignore +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/misc/vscode-cin/README.md +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/misc/vscode-cin/build.bat +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/misc/vscode-cin/language-configuration.json +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/misc/vscode-cin/package.json +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/misc/vscode-cin/snippets/cin.json +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/misc/vscode-cin/syntaxes/cin.tmLanguage.json +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/script/bump_version.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/script/check_paths.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/script/gen_isa_docs.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/script/gen_native_isa.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/setup.cfg +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_aot.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_assembler_ext.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_bin_compat.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_cin_host.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_cin_host_ext.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_cin_syntax.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_cin_syntax_ext.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_cin_system.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_compiler_errors.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_environment.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_examples.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_features_ab.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_features_import.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_gui.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_index_subscript_type.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_isa_single_source.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_issue_regress.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_keyboard.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_lib_compat.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_literals_and_bom.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_native_codegen.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_native_hardening.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_nested_subscript_codegen.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_no_go_cli.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_object_link.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_p0_fixes.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_paths_consistency.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_switch_semantics.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_v620_import.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_v620_packaging.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_version.py +0 -0
- {codecin-6.3.1 → codecin-7.0.0}/tests/test_workflows.py +0 -0
|
@@ -5,6 +5,268 @@
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [7.0.0] - 2026-11-01
|
|
9
|
+
|
|
10
|
+
一次以「编译产物格式统一 + AOT 去 Go 化」为主题的大版本:默认产物从 `.bin`
|
|
11
|
+
切换为可自描述的 `.sdgcc`(内部 `CODE` 段仍与 BIN v3 逐字节一致),`cvm`
|
|
12
|
+
改为读取 `mkn.toml` 驱动多文件编译,AOT 新增纯 C 后端(GCC/Clang/Zig),
|
|
13
|
+
不再依赖 Go 工具链即可产出 Windows PE 与 Linux ELF(x86-64 / AArch64)。
|
|
14
|
+
|
|
15
|
+
### 新增 (Added)
|
|
16
|
+
|
|
17
|
+
- **`.sdgcc` 编译产物容器**(`codecin/sdgcc.py`):28 字节头 + 24 字节/段的
|
|
18
|
+
定长段表,`CODE` 段逐字节保存 BIN v3,另附 `META`(TOML)、`SYMS`(标签)、
|
|
19
|
+
`SRCS`(源码清单)。`CODE` 与旧 `.bin` 完全同构,旧读取器可直接消费。
|
|
20
|
+
- **单文件 / 多文件模式**:容器内记录 `mode` 与源码清单;`cvm build` 对 mkn
|
|
21
|
+
项目默认**多文件**(入口 + `import` 闭包),`--single` 切换单文件模式。
|
|
22
|
+
- `cvm` 模块(CVM format 2)改为 `code/program.sdgcc` 成员,仍可读取旧
|
|
23
|
+
`code/program.bin`(format 1);`cvm build` 接受 `.sdgcc` / `.bin` 混合输入,
|
|
24
|
+
旧 `.bin` 输入会被原样封装。
|
|
25
|
+
- **AOT 工具链层**(`codecin/toolchain.py`):为去除 Go 依赖后的 C 后端提供
|
|
26
|
+
编译器发现与交叉编译支持——三个目标(`x86_64-windows` / `x86_64-linux` /
|
|
27
|
+
`aarch64-linux`)、`CODECIN_CC_<TARGET>` 覆盖、自带工具链目录、
|
|
28
|
+
`-dumpmachine` 目标校验,以及 `python -m codecin.toolchain install` 从镜像
|
|
29
|
+
下载/校验/解包(含路径穿越防护)。
|
|
30
|
+
- **AOT C 后端**(`codecin/cbackend.py`):把 UCBC 指令逐条展开成 C(寄存器
|
|
31
|
+
数组 + 显式 NZCV + 扁平内存 + 栈/call-ret),由 GCC/Clang 生成机器码;
|
|
32
|
+
不再经过 Go。已覆盖整数运算、比较跳转、`B`/`CBZ` 条件分支、内存读写、
|
|
33
|
+
`PUSH/POP/CALL/RET`、`OUT` 与核心 syscall(ALLOCFRAME/TIME/RAND/MALLOC/
|
|
34
|
+
ITOA/FTOA/PRINT_STR/ABORT 等),未实现指令在运行期以明确信息退出(码 1)。
|
|
35
|
+
与 VM 对同一 CIN 程序的输出已做逐字节比对。
|
|
36
|
+
- **C 后端 syscall 覆盖 0-38**:浮点数学(`sqrt/pow/sin/cos/tan/FADD…/FCMP/
|
|
37
|
+
FTOI/ITOF`)、整数/字符串(`abs/strlen/strcmp/strcpy/strcat/malloc/itoa/
|
|
38
|
+
ftoa/str_concat/bool_str/substr/indexof/upper/lower/trim/ltrim/rtrim/atoi`)
|
|
39
|
+
与 `floor/ceil/round`、`time/rand/srand`、`abort`,全部按 VM 语义实现
|
|
40
|
+
(含 `malloc` 16 字节对齐、`itoa` 有符号、`strcmp` 字节差、`substr` 越界裁剪)。
|
|
41
|
+
- **C 后端文件 I/O(SYS 51-57)**:`file_read/file_write/file_append/
|
|
42
|
+
file_exists/file_delete/file_size/mkdir`,返回值与 VM 对齐(失败 -1、
|
|
43
|
+
`file_read` 失败返回空串、`mkdir` 递归建目录),并与 VM 做了同一程序
|
|
44
|
+
的输出对拍。
|
|
45
|
+
- **C 后端系统层(SYS 58/61-67)**:`dirlist`(有序、目录带 `/`)、
|
|
46
|
+
`getenv/setenv`、`osname/hostname/username/cwd/homedir`;Windows 的
|
|
47
|
+
`username` 与 Go `user.Current()` 对齐为 `DOMAIN\user`。
|
|
48
|
+
- **C 后端网络(SYS 147-150/157)**:`tcp_dial/tcp_send/tcp_recv/tcp_close`
|
|
49
|
+
与 `dns_lookup`,Windows 走 Winsock(`-lws2_32`)、POSIX 走 BSD socket;
|
|
50
|
+
与 VM 在本地 echo 服务器上做了同程序对拍(收发字节数、退出码一致)。
|
|
51
|
+
- **C 后端 HTTP(SYS 97/98/145/146)**:`http_get`/`http_post`/`http_req` 与
|
|
52
|
+
`http_code`;URL 解析(host/port/path)、`Connection: close` 读尽响应、
|
|
53
|
+
8 MiB 上限、状态码记录,GET 与 POST 均与 VM 在本地 HTTP 服务上对拍。
|
|
54
|
+
- **C 后端 TCP 服务端(SYS 151/152)**:`tcp_listen/tcp_accept`,与
|
|
55
|
+
`tcp_recv/tcp_send/tcp_close` 组合可让 AOT 产物直接对外提供 TCP 服务;
|
|
56
|
+
已用 Python 客户端对 VM 与 AOT 两个版本做同一协议对拍。
|
|
57
|
+
- **C 后端 UDP(SYS 153-156)**:`udp_open/udp_sendto/udp_recvfrom/
|
|
58
|
+
udp_close`(可选 `ip:port` 回填),与 VM 在本地 UDP echo 对端上完成
|
|
59
|
+
收发字节数对拍。
|
|
60
|
+
- **C 后端 Base64(SYS 101/102)**:`base64_encode/base64_decode`
|
|
61
|
+
(标准字母表、`=` 填充、解码忽略空白与非法字符),与 VM 对拍一致。
|
|
62
|
+
- **C 后端 SHA-256(SYS 100)**:`sha256` 返回小写十六进制摘要(自实现
|
|
63
|
+
压缩函数,无第三方依赖),`"abc"` 与空串摘要均与 VM 一致。
|
|
64
|
+
- **C 后端画布(SYS 43-46/48/49)**:`canvas/set_color/fill_rect/
|
|
65
|
+
fill_circle/draw_line/save_png`,白底 RGBA8、坐标裁剪、Bresenham 直线,
|
|
66
|
+
PNG 用 zlib stored 块 + CRC32 手写输出;用例解码像素后校验红块/蓝圆/
|
|
67
|
+
绿线与白底,并与 VM 产物尺寸对齐。
|
|
68
|
+
- **C 后端 `download`(SYS 99)**:GET → 仅 2xx 落盘(非 2xx 或网络错误
|
|
69
|
+
返回 -1),与 VM 的 0/-1 语义一致,并有用例校验落盘内容。
|
|
70
|
+
- **C 后端 `show_canvas`(SYS 50)**:无窗口环境下明确返回 `-1`(不静默成功、
|
|
71
|
+
也不崩溃),画布内容仍可 `save_png` 落盘。
|
|
72
|
+
- **C 后端路径/环境补充(SYS 87/89/90)**:`is_dir`、`temp_dir`、`chdir`
|
|
73
|
+
(Windows 走 `_chdir`),与 VM 输出对拍一致。
|
|
74
|
+
- **C 后端 `dir_remove`(SYS 86)**:递归删除(`rm -rf` 语义),与 VM 对拍
|
|
75
|
+
一致,用例额外断言目录确实不存在。
|
|
76
|
+
- **C 后端 `file_copy`/`file_move`/`file_mtime`(SYS 84/85/88)**:复制、
|
|
77
|
+
重命名(跨盘回退为复制+删除)、mtime(unix 秒,失败 -1),与 VM 对拍一致。
|
|
78
|
+
- **C 后端 `path_join`/`path_basename`/`path_dirname`(SYS 80-82)**:
|
|
79
|
+
按平台分隔符归一化(Windows `\`,POSIX `/`)、折叠重复分隔符,与
|
|
80
|
+
`filepath.Join/Base/Dir` 输出一致。
|
|
81
|
+
- **C 后端 `path_abs`(SYS 83)**:Windows 用 `_fullpath`、POSIX 用
|
|
82
|
+
`realpath`(失败回退 `getcwd + 拼接`),输出与 `filepath.Abs` 一致。
|
|
83
|
+
- **C 后端不支持项提示更精确**:`supports()` 报错从「未实现的 SYS 47」升级为
|
|
84
|
+
「未实现的 SYS 47 (CANVASTEXT)」,`auto` 回退/`c` 报错时可直接看出缺什么。
|
|
85
|
+
对应端到端用例改为用 `draw_text` 触发,验证报错含 syscall 名。
|
|
86
|
+
- **C 后端时间/平台信息(SYS 91-94)**:`time_ms`(单调时钟)、
|
|
87
|
+
`sleep_ms`(上限 600s)、`cpu_count`、`arch_name`(amd64/arm64/x86),
|
|
88
|
+
与 VM 语义一致,并有用例验证计时单调与休眠生效。
|
|
89
|
+
- **C 后端 `mem_info`/`is_android`(SYS 95/96)**:`mem_info` 输出
|
|
90
|
+
`{"total_kb":N,"free_kb":M}`(Windows `GlobalMemoryStatusEx`、Linux 解析
|
|
91
|
+
`/proc/meminfo`);`is_android` 以 `/system/build.prop` 判定。
|
|
92
|
+
- **C 后端交叉编译打通(Zig 兜底)**:`toolchain.find_zig()` 自动发现
|
|
93
|
+
`~/.codecin/zig/**/zig` 或 `CODECIN_ZIG`,在缺少目标 GCC 时改用
|
|
94
|
+
`zig cc -target <triple>`(自带 libc,无需 sysroot)。已实测同一份指令流
|
|
95
|
+
交叉编译为 `x86_64-linux`(ELF e_machine 0x3E)与 `aarch64-linux`
|
|
96
|
+
(0xB7),并加入自动跳过式用例 `test_cross_compile_elf_targets`。
|
|
97
|
+
- **测试稳定性**:网络用例改用 `ThreadingTCPServer` + `daemon_threads`
|
|
98
|
+
并在 `finally` 里 `server_close()`;TCP 服务端用例改为按需重新分配端口
|
|
99
|
+
重试;`tcp_echo` 的对端在 accept 超时后直接退出。`tests/test_cbackend.py`
|
|
100
|
+
全量从偶发挂起恢复到 ~78s 稳定通过。
|
|
101
|
+
|
|
102
|
+
### 变更 (Changed)
|
|
103
|
+
|
|
104
|
+
- **AOT 默认走 C 后端**:`--build-backend auto` 在指令流可被 C 后端完整翻译时
|
|
105
|
+
使用「C → GCC/Clang」管线(不再经过 Go),遇到未覆盖的指令/syscall 才回退
|
|
106
|
+
旧的 Go 后端;新增 `--build-backend c` 可强制 C 后端(不支持时直接报出
|
|
107
|
+
具体指令/SYS 号,不静默换后端)。`--build-target windows/amd64`、
|
|
108
|
+
`linux/amd64`、`linux/arm64` 映射到 `x86_64-windows` / `x86_64-linux` /
|
|
109
|
+
`aarch64-linux`;AOT 输入新增 `.sdgcc`。
|
|
110
|
+
- `mkn build` / `codecin --compile-only` 默认产物由 `.bin` 改为 `.sdgcc`;
|
|
111
|
+
显式 `-o *.bin` 仍产出旧格式,`.bin` 作为**兼容输入**继续受支持。
|
|
112
|
+
- `crom.dump_bin()` 抽出序列化逻辑供容器复用,`cvm` 单文件编译不再落临时
|
|
113
|
+
`.bin`;`cvm build` 读取 `mkn.toml` 的 `[build] optimize/mem_size` 与
|
|
114
|
+
`entry`,产物元数据随之记录。
|
|
115
|
+
- **弃用 `--max-instructions`,默认不限制指令数**:`Config.max_instructions`
|
|
116
|
+
默认改为 `0`(0 = 不限),`aot`/`native_codegen` 的步数上限默认同步改为
|
|
117
|
+
0(引擎侧 `maxSteps <= 0` 即不限);`codecin`/`cvm` 的帮助中不再展示该
|
|
118
|
+
参数(保留为隐藏参数以兼容旧脚本)。死循环请用 `Ctrl+C` 中断。
|
|
119
|
+
|
|
120
|
+
### 修复 (Fixed)
|
|
121
|
+
|
|
122
|
+
- **安装提示仍在承诺纯 Python 回退**:`setup.py` 在 PATH 缺 `go` 时输出
|
|
123
|
+
「本次安装回退纯 Python 解释执行」,而 v5.9.0 起解释器与 JIT 已整体删除,
|
|
124
|
+
缺少 `codecin-native` 时程序根本无法执行。现改为说明真实后果与两条修复路径
|
|
125
|
+
(安装 Go 后重装 / 从 Release 取预编译库),并在安装收尾打印
|
|
126
|
+
`原生引擎: 可用/不可用` 汇总,避免 `pip install` 静默成功、首次运行才暴露。
|
|
127
|
+
- `codecin/native.py:get_engine()` 的 docstring 改为「无纯 Python 回退」,
|
|
128
|
+
与 `cpu.py` 的 native-only 语义一致。
|
|
129
|
+
|
|
130
|
+
### 已知限制 (Known limitations)
|
|
131
|
+
|
|
132
|
+
- **C 后端运行时尚未覆盖**:`draw_text`(47)(缺内嵌点阵字体)、音频
|
|
133
|
+
(39–42)、GUI 与键盘类 SYS。含这些调用的程序在 `--build-backend auto`
|
|
134
|
+
下会回退旧的 Go 后端,`--build-backend c` 会明确报出 `SYS 47
|
|
135
|
+
(CANVASTEXT)` 之类的功能号,不会静默产出错误结果。
|
|
136
|
+
- **交叉编译产物未在目标机执行验证**:`x86_64-linux` / `aarch64-linux`
|
|
137
|
+
已能产出合法 ELF(e_machine 0x3E / 0xB7),但本机为 Windows,未在
|
|
138
|
+
Linux 真机或 WSL 中运行过。
|
|
139
|
+
- **旧 Go 后端仍保留**:`--build-backend native|vm` 作为回退路径存在,
|
|
140
|
+
待 C 后端覆盖足够后再移除。
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## [6.4.2] - 2026-10-31
|
|
145
|
+
|
|
146
|
+
一次以「内置标准库 pic 包化 / 注册表文档补全」为主题的维护发布。
|
|
147
|
+
|
|
148
|
+
### 新增 (Added)
|
|
149
|
+
|
|
150
|
+
- `codecin/lib/<name>/`:41 个内置标准库改为 pic 包目录(`pic.toml` +
|
|
151
|
+
`src/<name>.cin`),可独立 `pic build` / `pic install`;新增
|
|
152
|
+
`script/sync_stdlib_packages.py` 负责生成、`--check` 校验与 `--build` 构建,
|
|
153
|
+
CI 校验包结构一致性。
|
|
154
|
+
|
|
155
|
+
### 变更 (Changed)
|
|
156
|
+
|
|
157
|
+
- 内置标准库改为 `codecin/lib/<name>/` 包目录,运行时直接解析
|
|
158
|
+
`codecin/lib/<name>/src/<name>.cin`;`import "math.cin"` / `import "lib/math.cin"`
|
|
159
|
+
写法不变,`import "math"` 也可用。
|
|
160
|
+
- 版本号提升至 **6.4.2**(`codecin/__init__.py` 单一真源,Go 侧
|
|
161
|
+
`version_gen.go` 与 registry 服务端同步)。
|
|
162
|
+
- registry README 补全发布字段、搜索参数、下载 ETag/Range、错误码、认证缓存、
|
|
163
|
+
后台 UI 与 Docker/nginx/备份说明;Dockerfile 增加健康检查。
|
|
164
|
+
- 41 个内置库已发布到中央注册表 `package.codecin.org.cn`(6.4.2),`repo` 统一为
|
|
165
|
+
`https://gitee.com/codecin/internal-libraries`。
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## [6.4.0] - 2026-10-30
|
|
170
|
+
|
|
171
|
+
一次以「pic 搜索 / 版本管理 / 分块导入」为主题的发布:CIN 的 `import` 现在可以
|
|
172
|
+
按包、模块和版本选择(`rich:*` / `rich:table` / `rich::1.1.1:*`),不再只能
|
|
173
|
+
整包导入;`pic install` 默认安装最新版本;中央注册服务器补齐搜索、统计、
|
|
174
|
+
latest 指针、版本删除与浏览器后台管理页。
|
|
175
|
+
|
|
176
|
+
### 新增 (Added)
|
|
177
|
+
|
|
178
|
+
#### CIN 分块导入 (pic 包)
|
|
179
|
+
|
|
180
|
+
- `import` 新增包规格语法,与 `pic install` 共用
|
|
181
|
+
`codecin/packaging/spec.py`:
|
|
182
|
+
- `import "rich"` —— 包入口(兼容旧写法);
|
|
183
|
+
- `import "rich:*"` —— 入口 + 全部公开模块;
|
|
184
|
+
- `import "rich:table"` / `import "rich:table,markdown"` —— 指定模块;
|
|
185
|
+
- `import "rich::1.1.1:*"` / `import "rich::1.1.1:table"` —— 指定版本;
|
|
186
|
+
- `import "rich@1.1.1:table"` —— 旧式版本写法。
|
|
187
|
+
- 通配 `*` 跳过 `main.cin`、`test/`、`demo/`、`internal/` 等非公开模块;
|
|
188
|
+
显式选择私有模块时先展开入口,避免 `rich` 的 `internal/table.cin`
|
|
189
|
+
依赖 `style.cin` 符号而编译失败。
|
|
190
|
+
- 包版本解析支持全局存储 `$PIC_HOME/packages/<name>/<current>` 与显式
|
|
191
|
+
`::<版本>`;版本未安装时给出 `pic install <name>@<version>` 的可执行提示。
|
|
192
|
+
- 新增 `pic modules <name>`:列出已安装/远程包内可导入模块,并给出
|
|
193
|
+
`import "<name>:*"`、`import "<name>:<module>"` 示例。
|
|
194
|
+
|
|
195
|
+
#### pic 安装与搜索
|
|
196
|
+
|
|
197
|
+
- **默认安装最新版本**:`pic install <name>` 不写版本时按中央注册表的
|
|
198
|
+
`latest` 指针(无指针时取最高未撤回版本)解析,即使本地已安装旧版本
|
|
199
|
+
也会升级;`--project` 安装同样适用。`name@^1.2` / `name@1.2.3` 保持
|
|
200
|
+
“满足约束即可”的旧语义。
|
|
201
|
+
- `pic install` 支持 `name:*` / `name::<版本>:*` 规格;选择器只影响安装后
|
|
202
|
+
推荐的 `import` 写法,安装始终复制整个包。
|
|
203
|
+
- `pic search` 大幅增强:
|
|
204
|
+
- 搜索范围扩展为包名 / 仓库 / 描述 / 关键词;
|
|
205
|
+
- 相关度排序(精确 > 前缀 > 包含 > 关键词 > 描述 > 仓库);
|
|
206
|
+
- `--sort name|latest|updated|downloads|versions`、`--order asc|desc`、
|
|
207
|
+
`--limit` / `--offset` 分页、`--keyword` 过滤、`--json`;
|
|
208
|
+
- 输出 latest、版本数、下载量与描述。
|
|
209
|
+
- 新增 `pic versions <name>`(latest / yanked / installed 标记)、
|
|
210
|
+
`pic info <name>`(仓库、描述、关键词、许可证、入口、模块、下载量、
|
|
211
|
+
版本列表)。搜索、`versions`、`info`、`registry list` 改为公开只读,
|
|
212
|
+
无需登录。
|
|
213
|
+
|
|
214
|
+
#### pic 版本管理与后台
|
|
215
|
+
|
|
216
|
+
- 中央注册服务器新增:
|
|
217
|
+
- `latest` 指针与 `POST /api/v1/packages/{name}/{version}/latest`;
|
|
218
|
+
- 版本/整包删除 `DELETE /api/v1/packages/{name}[/{version}]`;
|
|
219
|
+
- 统计 `GET /api/v1/stats`、当前用户 `GET /api/v1/me`;
|
|
220
|
+
- 制品下载计数与包级/版本级 `downloads`;
|
|
221
|
+
- 发布时保存描述、关键词、许可证、入口、模块列表。
|
|
222
|
+
- 搜索 API 支持 `q` / `keyword` / `sort` / `order` / `limit` / `offset`,
|
|
223
|
+
返回 `total` / `count` / `offset` / `limit`,并包含描述、关键词、
|
|
224
|
+
下载量、已撤回版本数。
|
|
225
|
+
- 新增 `/admin` 浏览器后台管理页(零外部前端依赖):
|
|
226
|
+
- 统计卡片、包搜索/排序、包详情与版本表;
|
|
227
|
+
- 撤回/恢复版本、设置 latest、删除版本、删除整个包;
|
|
228
|
+
- 令牌保存在浏览器 `localStorage`,支持 URL fragment 传入;
|
|
229
|
+
- 管理员由 `PIC_ADMIN_EMAILS` / `PIC_ADMIN_IDS` 配置,未配置时发布者
|
|
230
|
+
仍可管理自己发布的包。
|
|
231
|
+
- 新增 `pic yank` / `pic unyank` / `pic latest` / `pic use` / `pic admin`
|
|
232
|
+
(`--no-browser` / `--print-token`)命令。
|
|
233
|
+
- latest 指向的版本被撤回时,解析自动回退到最高未撤回版本;
|
|
234
|
+
设置 latest 时拒绝已撤回版本。
|
|
235
|
+
|
|
236
|
+
### 变更 (Changed)
|
|
237
|
+
|
|
238
|
+
- 版本号提升至 **6.4.0**(`codecin/__init__.py` 单一真源,
|
|
239
|
+
`codecin/native/engine/version_gen.go` 同步;registry 服务端版本同步)。
|
|
240
|
+
- `pic install <name>` 不再优先复用本地任意已安装版本;默认 latest 会
|
|
241
|
+
升级到服务端最新版本。需要固定旧版本时显式写 `name@<版本>`。
|
|
242
|
+
- CIN `import "name"` / `import "name:*"` 默认选择**最高已安装版本**,
|
|
243
|
+
不再受 `$PIC_HOME/index.json` 的 `current` 指针影响(`current` 仍供
|
|
244
|
+
`pic show` / `pic use` 等本地命令使用);显式 `name::<版本>` 不变。
|
|
245
|
+
- 包记录新增可选字段 `latest` / `latest_pointer` / `description` /
|
|
246
|
+
`keywords` / `license` / `homepage` / `entry` / `modules` / `downloads`;
|
|
247
|
+
旧记录缺少这些字段时按默认值读取,向后兼容。
|
|
248
|
+
- `DELETE /api/v1/packages/{name}` 由 405 改为可删除(发布者或管理员);
|
|
249
|
+
删除不可恢复,后台页会二次确认。
|
|
250
|
+
- 服务端搜索默认按相关度/名称排序,`pic search` 输出列由 `REPO` 改为
|
|
251
|
+
`VERSIONS` / `DOWNLOADS` / `DESCRIPTION`。
|
|
252
|
+
|
|
253
|
+
### 修复 (Fixed)
|
|
254
|
+
|
|
255
|
+
- 修复 `pic install <name>` 在本地已安装旧版本时不会升级的问题。
|
|
256
|
+
- 修复 `pic search` 只能匹配包名/仓库、无法按描述/关键词搜索的问题。
|
|
257
|
+
- 修复 `pic` 缺少版本列表、latest、撤回恢复与后台管理入口的问题。
|
|
258
|
+
- 修复 `rich` 等包含私有模块的包在分块导入时缺少入口符号导致的
|
|
259
|
+
`Unknown function` 编译错误。
|
|
260
|
+
- 修复服务端统计中已撤回版本仍可能被当作 latest 的问题。
|
|
261
|
+
|
|
262
|
+
### 兼容性
|
|
263
|
+
|
|
264
|
+
- 既有 `import "./x.cin"`、`import "math.cin"`、`import "hello"`、
|
|
265
|
+
`import "hello/util.cin"` 写法全部保持;不带冒号的包名仍先查内置标准库。
|
|
266
|
+
- `pic install name@version`、`git+URL`、本地路径、`.cinpkg`、`mkn`
|
|
267
|
+
依赖解析行为不变;`mkn` 的空版本依赖同样默认最新。
|
|
268
|
+
- 服务端旧包记录可直接读取;`pic.lock` 格式不变。
|
|
269
|
+
|
|
8
270
|
## [6.3.1] - 2026-10-25
|
|
9
271
|
|
|
10
272
|
一次以「终端缓存与实时输出」为主题的小版本:新增终端缓存技术,启动/编译期间
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
include README.md CHANGELOG.md LICENSE
|
|
5
5
|
include pyproject.toml setup.py
|
|
6
|
-
recursive-include codecin/lib *.cin
|
|
6
|
+
recursive-include codecin/lib *.cin *.toml
|
|
7
7
|
recursive-include codecin/native *.go *.txt go.mod go.sum build.sh build.ps1
|
|
8
8
|
# 注: 不 include 预编译原生库 (*.dll/*.so/*.dylib) —— 它们在用户安装时由
|
|
9
9
|
# setup.py 现场编译, 见 pyproject.toml 的 package-data 说明。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codecin
|
|
3
|
-
Version:
|
|
3
|
+
Version: 7.0.0
|
|
4
4
|
Summary: Code CIN - 高级语言与运行时 (CIN/PL/ASM 工具链 + Go 原生 VM + ARM64/RISC-V/FP/Vector 指令集)
|
|
5
5
|
Author: ByUsi Studio, 北啊呢
|
|
6
6
|
License-Expression: MIT
|
|
@@ -34,14 +34,14 @@ Code CIN 是一门简洁的类 C 高级语言及其跨平台运行时(VM)。
|
|
|
34
34
|
|
|
35
35
|
模块化包结构(`codecin/`,Go 侧 `codecin/native/`),全线日志与错误输出基于 **rich**(彩色表格、面板、traceback),`--debug` / `--log-level DEBUG` 提供超详细诊断。
|
|
36
36
|
|
|
37
|
-
## v6.2.0 工具链:mkn / pic / cvm
|
|
37
|
+
## v6.2.0+ 工具链:mkn / pic / cvm
|
|
38
38
|
|
|
39
39
|
v6.2.0 在 `codecin` 之外提供三个独立命令,覆盖**构建 → 分发 → 运行**:
|
|
40
40
|
|
|
41
41
|
| 命令 | 类比 | 作用 |
|
|
42
42
|
|------|------|------|
|
|
43
43
|
| `mkn` | Maven | 项目清单、标准目录、生命周期、依赖解析、打包与本地仓库 |
|
|
44
|
-
| `pic` | pip | `package.codecin.org.cn` 中央注册/分发 + Cdifit 登录:发布登记标识名/Git 地址/版本列表/安全摘要并上传 `.cinpkg`,安装后可直接 `import` |
|
|
44
|
+
| `pic` | pip | `package.codecin.org.cn` 中央注册/分发 + Cdifit 登录:发布登记标识名/Git 地址/版本列表/安全摘要并上传 `.cinpkg`,安装后可直接 `import`;支持搜索、版本管理与 `/admin` 后台 |
|
|
45
45
|
| `cvm` | JVM | Code CIN 虚拟机:构建/校验/运行 `.cvm` 模块,支持模块路径;`CPU` 仅作为内部执行核 |
|
|
46
46
|
|
|
47
47
|
```bash
|
|
@@ -56,8 +56,14 @@ mkn package # target/demo-0.1.0.mkn
|
|
|
56
56
|
pic login
|
|
57
57
|
pic init hello
|
|
58
58
|
pic publish --repo https://github.com/you/cin-hello --name hello
|
|
59
|
+
pic install hello # 不写版本 -> 最新版本
|
|
59
60
|
pic install hello@^1.0 # 或 git+https://...、本地路径、.cinpkg
|
|
60
61
|
pic install hello --project # 安装到项目 pic_modules/,可直接 import
|
|
62
|
+
pic search hello --json # 搜索 (名称/描述/关键词, 分页/排序)
|
|
63
|
+
pic versions hello # 版本列表 (latest/yanked/installed)
|
|
64
|
+
pic info hello # 包详情
|
|
65
|
+
pic use hello 1.0.0 # 切换本地 current 版本
|
|
66
|
+
pic admin # 后台管理页 (版本/撤回/删除/latest)
|
|
61
67
|
pic whoami
|
|
62
68
|
pic logout
|
|
63
69
|
|
|
@@ -73,11 +79,15 @@ cvm env
|
|
|
73
79
|
登录和 Token 校验**。服务端实现见 [registry/README.md](registry/README.md),
|
|
74
80
|
客户端可用 `PIC_REGISTRY_URL` 覆盖服务器地址。
|
|
75
81
|
|
|
76
|
-
|
|
82
|
+
安装后的包无需修改源码即可导入,并支持按模块/版本分块导入
|
|
83
|
+
(不写版本时默认使用最高已安装版本):
|
|
77
84
|
|
|
78
85
|
```cin
|
|
79
86
|
import "hello"
|
|
80
87
|
import "hello/util.cin"
|
|
88
|
+
import "hello:*" // 全部公开模块
|
|
89
|
+
import "hello:util" // 只导入 util 模块
|
|
90
|
+
import "hello::1.0.0:*" // 指定版本的全部公开模块
|
|
81
91
|
```
|
|
82
92
|
|
|
83
93
|
## 文档
|
|
@@ -186,7 +196,7 @@ graph LR
|
|
|
186
196
|
| 日志系统 | rich | 彩色日志/表格/面板/traceback, --debug / --log-level DEBUG 超详细诊断 |
|
|
187
197
|
| 性能分析 | 指令级 | CPI + 内存统计 + 热指令 |
|
|
188
198
|
| CROM压缩 | zlib | 段式格式 (v4), 只保存已分配页 (Go/Python双实现) |
|
|
189
|
-
| AOT 静态编译 | 独立可执行 |
|
|
199
|
+
| AOT 静态编译 | 独立可执行 | C 后端把指令逐条翻译成 C, 由 GCC/Clang 生成机器码 (Windows/Linux, x86-64/AArch64); 未覆盖指令回退 Go 后端 |
|
|
190
200
|
|
|
191
201
|
---
|
|
192
202
|
|
|
@@ -444,7 +454,7 @@ flowchart TD
|
|
|
444
454
|
**安装(pip)**
|
|
445
455
|
|
|
446
456
|
```bash
|
|
447
|
-
pip install codecin # 安装 (内置标准库 codecin/lib/*.cin 随包分发)
|
|
457
|
+
pip install codecin # 安装 (内置标准库 codecin/lib/<name>/src/*.cin 随包分发)
|
|
448
458
|
pip install -U codecin # 升级到最新版 (不要锁定版本号)
|
|
449
459
|
codecin --version
|
|
450
460
|
```
|
|
@@ -506,24 +516,45 @@ v5.9.0 起**只有一条执行路径**: Python 完成 CIN/PL/ASM 编译后, 通
|
|
|
506
516
|
Python、Go 工具链、libc 或任何动态库**。CIN 构建时会解析 `import` 闭包做依赖
|
|
507
517
|
完整性检查, 并把**全部依赖库在编译期展开嵌入产物** (产物不读取任何 `.cin` 文件)。
|
|
508
518
|
|
|
509
|
-
默认使用 **auto 后端**:
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
519
|
+
默认使用 **auto 后端**: 指令流能被 **C 后端**(`codecin/cbackend.py`)完整翻译时,
|
|
520
|
+
逐条展开成 C,再由本机或交叉 **GCC/Clang** 编译成机器码——**不再依赖 Go 工具链**;
|
|
521
|
+
遇到尚未覆盖的指令或 syscall 时回退到旧的 Go 后端(`native`/`vm`)。
|
|
522
|
+
`--build-backend auto|c|native|vm` 可强制指定,`c` 遇到不支持的程序会直接报出
|
|
523
|
+
具体指令/syscall,不会静默换后端。
|
|
524
|
+
|
|
525
|
+
C 后端的目标:`x86_64-windows`(PE)、`x86_64-linux`(ELF)、`aarch64-linux`
|
|
526
|
+
(ELF),与 `--build-target windows/amd64` 等写法一一对应。缺少交叉编译器时按
|
|
527
|
+
提示安装,或 `python -m codecin.toolchain install <target> --url <压缩包>` 安装
|
|
528
|
+
自带工具链。
|
|
529
|
+
|
|
530
|
+
C 后端当前覆盖的 syscall(未列出的会让 `auto` 回退 Go 后端,`c` 则报错):
|
|
531
|
+
|
|
532
|
+
| 范围 | 能力 |
|
|
533
|
+
|------|------|
|
|
534
|
+
| 0–38 | 浮点/整数/字符串/`itoa`/`ftoa`/`malloc`/`substr`/`trim`/`atoi` 等 |
|
|
535
|
+
| 43–46, 48–50 | 画布:新建、颜色、矩形、圆、直线、`save_png`;`show_canvas` 无窗口环境下返回 -1 |
|
|
536
|
+
| 51–58 | 文件读写/追加/存在/删除/大小/建目录、`dirlist` |
|
|
537
|
+
| 61–67 | 环境变量、`osname/hostname/username/cwd/homedir` |
|
|
538
|
+
| 80–90 | `path_join/basename/dirname/abs`、`file_copy`/`file_move`/`dir_remove`/`is_dir`/`file_mtime`/`temp_dir`/`chdir` |
|
|
539
|
+
| 91–94 | `time_ms`、`sleep_ms`、`cpu_count`、`arch_name` |
|
|
540
|
+
| 97–102 | `http_get`/`http_post`/`download`/`sha256`/`base64` |
|
|
541
|
+
| 137, 145–157 | `ALLOCFRAME`、`http_req`/`http_code`、TCP 客户端与服务端、UDP、DNS |
|
|
542
|
+
|
|
543
|
+
未覆盖:`draw_text`(47)、音频(39–42)、GUI/键盘。这些 syscall 会让 `auto`
|
|
544
|
+
回退 Go 后端;用 `--build-backend c` 强制时会明确报出功能号。
|
|
515
545
|
|
|
516
546
|
```bash
|
|
517
|
-
# 本机平台 (auto:
|
|
547
|
+
# 本机平台 (auto: 能走 C 后端就走 C, 否则回退 Go 后端)
|
|
518
548
|
codecin program.cin --build-exe program # Windows 自动补 .exe
|
|
519
549
|
|
|
520
|
-
# 交叉编译 (
|
|
550
|
+
# 交叉编译 (C 后端需要对应目标的 GCC/Clang; Go 后端只需 Go 工具链)
|
|
521
551
|
codecin program.cin --build-exe app-linux --build-target linux/amd64
|
|
522
|
-
codecin program.cin --build-exe app-
|
|
552
|
+
codecin program.cin --build-exe app-arm --build-target linux/arm64
|
|
523
553
|
|
|
524
554
|
# 强制某个后端 + 优化级别
|
|
555
|
+
codecin program.cin --build-exe app-c --build-backend c --optimize 2
|
|
525
556
|
codecin program.cin --build-exe app-native --build-backend native --optimize 2
|
|
526
|
-
codecin program.cin --build-exe app-vm
|
|
557
|
+
codecin program.cin --build-exe app-vm --build-backend vm --optimize 2
|
|
527
558
|
|
|
528
559
|
# 独立编译 + 链接 (ASM/PL): 每个对象单独汇编, 再由链接器合并
|
|
529
560
|
codecin --emit-object main.asm -o main.co
|
|
@@ -16,14 +16,14 @@ Code CIN 是一门简洁的类 C 高级语言及其跨平台运行时(VM)。
|
|
|
16
16
|
|
|
17
17
|
模块化包结构(`codecin/`,Go 侧 `codecin/native/`),全线日志与错误输出基于 **rich**(彩色表格、面板、traceback),`--debug` / `--log-level DEBUG` 提供超详细诊断。
|
|
18
18
|
|
|
19
|
-
## v6.2.0 工具链:mkn / pic / cvm
|
|
19
|
+
## v6.2.0+ 工具链:mkn / pic / cvm
|
|
20
20
|
|
|
21
21
|
v6.2.0 在 `codecin` 之外提供三个独立命令,覆盖**构建 → 分发 → 运行**:
|
|
22
22
|
|
|
23
23
|
| 命令 | 类比 | 作用 |
|
|
24
24
|
|------|------|------|
|
|
25
25
|
| `mkn` | Maven | 项目清单、标准目录、生命周期、依赖解析、打包与本地仓库 |
|
|
26
|
-
| `pic` | pip | `package.codecin.org.cn` 中央注册/分发 + Cdifit 登录:发布登记标识名/Git 地址/版本列表/安全摘要并上传 `.cinpkg`,安装后可直接 `import` |
|
|
26
|
+
| `pic` | pip | `package.codecin.org.cn` 中央注册/分发 + Cdifit 登录:发布登记标识名/Git 地址/版本列表/安全摘要并上传 `.cinpkg`,安装后可直接 `import`;支持搜索、版本管理与 `/admin` 后台 |
|
|
27
27
|
| `cvm` | JVM | Code CIN 虚拟机:构建/校验/运行 `.cvm` 模块,支持模块路径;`CPU` 仅作为内部执行核 |
|
|
28
28
|
|
|
29
29
|
```bash
|
|
@@ -38,8 +38,14 @@ mkn package # target/demo-0.1.0.mkn
|
|
|
38
38
|
pic login
|
|
39
39
|
pic init hello
|
|
40
40
|
pic publish --repo https://github.com/you/cin-hello --name hello
|
|
41
|
+
pic install hello # 不写版本 -> 最新版本
|
|
41
42
|
pic install hello@^1.0 # 或 git+https://...、本地路径、.cinpkg
|
|
42
43
|
pic install hello --project # 安装到项目 pic_modules/,可直接 import
|
|
44
|
+
pic search hello --json # 搜索 (名称/描述/关键词, 分页/排序)
|
|
45
|
+
pic versions hello # 版本列表 (latest/yanked/installed)
|
|
46
|
+
pic info hello # 包详情
|
|
47
|
+
pic use hello 1.0.0 # 切换本地 current 版本
|
|
48
|
+
pic admin # 后台管理页 (版本/撤回/删除/latest)
|
|
43
49
|
pic whoami
|
|
44
50
|
pic logout
|
|
45
51
|
|
|
@@ -55,11 +61,15 @@ cvm env
|
|
|
55
61
|
登录和 Token 校验**。服务端实现见 [registry/README.md](registry/README.md),
|
|
56
62
|
客户端可用 `PIC_REGISTRY_URL` 覆盖服务器地址。
|
|
57
63
|
|
|
58
|
-
|
|
64
|
+
安装后的包无需修改源码即可导入,并支持按模块/版本分块导入
|
|
65
|
+
(不写版本时默认使用最高已安装版本):
|
|
59
66
|
|
|
60
67
|
```cin
|
|
61
68
|
import "hello"
|
|
62
69
|
import "hello/util.cin"
|
|
70
|
+
import "hello:*" // 全部公开模块
|
|
71
|
+
import "hello:util" // 只导入 util 模块
|
|
72
|
+
import "hello::1.0.0:*" // 指定版本的全部公开模块
|
|
63
73
|
```
|
|
64
74
|
|
|
65
75
|
## 文档
|
|
@@ -168,7 +178,7 @@ graph LR
|
|
|
168
178
|
| 日志系统 | rich | 彩色日志/表格/面板/traceback, --debug / --log-level DEBUG 超详细诊断 |
|
|
169
179
|
| 性能分析 | 指令级 | CPI + 内存统计 + 热指令 |
|
|
170
180
|
| CROM压缩 | zlib | 段式格式 (v4), 只保存已分配页 (Go/Python双实现) |
|
|
171
|
-
| AOT 静态编译 | 独立可执行 |
|
|
181
|
+
| AOT 静态编译 | 独立可执行 | C 后端把指令逐条翻译成 C, 由 GCC/Clang 生成机器码 (Windows/Linux, x86-64/AArch64); 未覆盖指令回退 Go 后端 |
|
|
172
182
|
|
|
173
183
|
---
|
|
174
184
|
|
|
@@ -426,7 +436,7 @@ flowchart TD
|
|
|
426
436
|
**安装(pip)**
|
|
427
437
|
|
|
428
438
|
```bash
|
|
429
|
-
pip install codecin # 安装 (内置标准库 codecin/lib/*.cin 随包分发)
|
|
439
|
+
pip install codecin # 安装 (内置标准库 codecin/lib/<name>/src/*.cin 随包分发)
|
|
430
440
|
pip install -U codecin # 升级到最新版 (不要锁定版本号)
|
|
431
441
|
codecin --version
|
|
432
442
|
```
|
|
@@ -488,24 +498,45 @@ v5.9.0 起**只有一条执行路径**: Python 完成 CIN/PL/ASM 编译后, 通
|
|
|
488
498
|
Python、Go 工具链、libc 或任何动态库**。CIN 构建时会解析 `import` 闭包做依赖
|
|
489
499
|
完整性检查, 并把**全部依赖库在编译期展开嵌入产物** (产物不读取任何 `.cin` 文件)。
|
|
490
500
|
|
|
491
|
-
默认使用 **auto 后端**:
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
501
|
+
默认使用 **auto 后端**: 指令流能被 **C 后端**(`codecin/cbackend.py`)完整翻译时,
|
|
502
|
+
逐条展开成 C,再由本机或交叉 **GCC/Clang** 编译成机器码——**不再依赖 Go 工具链**;
|
|
503
|
+
遇到尚未覆盖的指令或 syscall 时回退到旧的 Go 后端(`native`/`vm`)。
|
|
504
|
+
`--build-backend auto|c|native|vm` 可强制指定,`c` 遇到不支持的程序会直接报出
|
|
505
|
+
具体指令/syscall,不会静默换后端。
|
|
506
|
+
|
|
507
|
+
C 后端的目标:`x86_64-windows`(PE)、`x86_64-linux`(ELF)、`aarch64-linux`
|
|
508
|
+
(ELF),与 `--build-target windows/amd64` 等写法一一对应。缺少交叉编译器时按
|
|
509
|
+
提示安装,或 `python -m codecin.toolchain install <target> --url <压缩包>` 安装
|
|
510
|
+
自带工具链。
|
|
511
|
+
|
|
512
|
+
C 后端当前覆盖的 syscall(未列出的会让 `auto` 回退 Go 后端,`c` 则报错):
|
|
513
|
+
|
|
514
|
+
| 范围 | 能力 |
|
|
515
|
+
|------|------|
|
|
516
|
+
| 0–38 | 浮点/整数/字符串/`itoa`/`ftoa`/`malloc`/`substr`/`trim`/`atoi` 等 |
|
|
517
|
+
| 43–46, 48–50 | 画布:新建、颜色、矩形、圆、直线、`save_png`;`show_canvas` 无窗口环境下返回 -1 |
|
|
518
|
+
| 51–58 | 文件读写/追加/存在/删除/大小/建目录、`dirlist` |
|
|
519
|
+
| 61–67 | 环境变量、`osname/hostname/username/cwd/homedir` |
|
|
520
|
+
| 80–90 | `path_join/basename/dirname/abs`、`file_copy`/`file_move`/`dir_remove`/`is_dir`/`file_mtime`/`temp_dir`/`chdir` |
|
|
521
|
+
| 91–94 | `time_ms`、`sleep_ms`、`cpu_count`、`arch_name` |
|
|
522
|
+
| 97–102 | `http_get`/`http_post`/`download`/`sha256`/`base64` |
|
|
523
|
+
| 137, 145–157 | `ALLOCFRAME`、`http_req`/`http_code`、TCP 客户端与服务端、UDP、DNS |
|
|
524
|
+
|
|
525
|
+
未覆盖:`draw_text`(47)、音频(39–42)、GUI/键盘。这些 syscall 会让 `auto`
|
|
526
|
+
回退 Go 后端;用 `--build-backend c` 强制时会明确报出功能号。
|
|
497
527
|
|
|
498
528
|
```bash
|
|
499
|
-
# 本机平台 (auto:
|
|
529
|
+
# 本机平台 (auto: 能走 C 后端就走 C, 否则回退 Go 后端)
|
|
500
530
|
codecin program.cin --build-exe program # Windows 自动补 .exe
|
|
501
531
|
|
|
502
|
-
# 交叉编译 (
|
|
532
|
+
# 交叉编译 (C 后端需要对应目标的 GCC/Clang; Go 后端只需 Go 工具链)
|
|
503
533
|
codecin program.cin --build-exe app-linux --build-target linux/amd64
|
|
504
|
-
codecin program.cin --build-exe app-
|
|
534
|
+
codecin program.cin --build-exe app-arm --build-target linux/arm64
|
|
505
535
|
|
|
506
536
|
# 强制某个后端 + 优化级别
|
|
537
|
+
codecin program.cin --build-exe app-c --build-backend c --optimize 2
|
|
507
538
|
codecin program.cin --build-exe app-native --build-backend native --optimize 2
|
|
508
|
-
codecin program.cin --build-exe app-vm
|
|
539
|
+
codecin program.cin --build-exe app-vm --build-backend vm --optimize 2
|
|
509
540
|
|
|
510
541
|
# 独立编译 + 链接 (ASM/PL): 每个对象单独汇编, 再由链接器合并
|
|
511
542
|
codecin --emit-object main.asm -o main.co
|
|
@@ -835,10 +835,10 @@ def _compile_program(program_file: str,
|
|
|
835
835
|
'deps': [program_file],
|
|
836
836
|
}
|
|
837
837
|
|
|
838
|
-
if ext not in ('.asm', '.pl', '.bin'):
|
|
838
|
+
if ext not in ('.asm', '.pl', '.bin', '.sdgcc'):
|
|
839
839
|
raise AotError(f'不支持 AOT 输入格式: {ext or "(无扩展名)"}')
|
|
840
840
|
|
|
841
|
-
# ASM/PL 由 Assembler 装载; BIN 由 crom.load_bin 解码。
|
|
841
|
+
# ASM/PL 由 Assembler 装载; BIN/SDGCC 由 crom.load_bin 解码。
|
|
842
842
|
from . import Config
|
|
843
843
|
from .cpu import CPU
|
|
844
844
|
from .errors import CPUSimulatorError
|
|
@@ -871,7 +871,7 @@ def build_from_ir(instructions,
|
|
|
871
871
|
out: str,
|
|
872
872
|
target: Optional[str] = None,
|
|
873
873
|
backend: str = 'auto',
|
|
874
|
-
max_instructions: int =
|
|
874
|
+
max_instructions: int = 0,
|
|
875
875
|
optimize: int = 0,
|
|
876
876
|
program_name: str = 'linked',
|
|
877
877
|
keep_temp: bool = False,
|
|
@@ -902,23 +902,41 @@ def build_from_ir(instructions,
|
|
|
902
902
|
if use_cache and cache_key and _cache_lookup(cache_key, goos, out, logger):
|
|
903
903
|
return os.path.abspath(out)
|
|
904
904
|
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
f'{
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
905
|
+
from . import cbackend
|
|
906
|
+
c_ok, c_reason = cbackend.supports(instructions)
|
|
907
|
+
if backend == 'c':
|
|
908
|
+
if not c_ok:
|
|
909
|
+
raise AotError(f'C 后端不支持该程序: {c_reason}')
|
|
910
|
+
effective = 'c'
|
|
911
|
+
elif backend == 'auto':
|
|
912
|
+
effective = 'c' if c_ok else resolve_backend('auto',
|
|
913
|
+
len(instructions))
|
|
914
|
+
if not c_ok and logger:
|
|
915
|
+
logger.info(f'AOT: C 后端不适用 ({c_reason}), '
|
|
916
|
+
f'改走 {effective} 后端')
|
|
917
|
+
else:
|
|
918
|
+
effective = resolve_backend(backend, len(instructions))
|
|
919
|
+
|
|
920
|
+
if effective == 'c':
|
|
921
|
+
goos2, goarch2 = parse_target(target) if target else \
|
|
922
|
+
parse_target(host_target())
|
|
923
|
+
try:
|
|
924
|
+
cname = cbackend.c_target(goos2, goarch2)
|
|
925
|
+
except cbackend.CBackendError as e:
|
|
926
|
+
raise AotError(str(e)) from e
|
|
927
|
+
try:
|
|
928
|
+
built = cbackend.compile_instructions(
|
|
929
|
+
instructions, labels, segments, entry_pc, mem_size, sp,
|
|
930
|
+
heap_base, out, target=cname, optimize=optimize)
|
|
931
|
+
except cbackend.CBackendError as e:
|
|
932
|
+
raise AotError(f'C 后端编译失败: {e}') from e
|
|
933
|
+
elif effective == 'vm':
|
|
917
934
|
built = build(bytes(bytecode), seg_file, out, target=target,
|
|
918
935
|
keep_temp=keep_temp, debug=debug, logger=logger)
|
|
919
936
|
else:
|
|
920
937
|
if effective != 'native':
|
|
921
|
-
raise AotError(
|
|
938
|
+
raise AotError(
|
|
939
|
+
f'未知 AOT 后端: {backend} (可选 auto / c / native / vm)')
|
|
922
940
|
|
|
923
941
|
from .native_codegen import NativeCodegenError, generate_go_source
|
|
924
942
|
try:
|
|
@@ -948,7 +966,7 @@ def build_program(program_file: str,
|
|
|
948
966
|
keep_temp: bool = False,
|
|
949
967
|
mem_size: Optional[int] = None,
|
|
950
968
|
backend: str = 'auto',
|
|
951
|
-
max_instructions: int =
|
|
969
|
+
max_instructions: int = 0,
|
|
952
970
|
optimize: int = 0,
|
|
953
971
|
use_cache: bool = True,
|
|
954
972
|
debug: bool = False,
|