Old page wikitext, before the edit (old_wikitext) | '' |
New page wikitext, after the edit (new_wikitext) | '== Introduction ==
Hi, I'm Kamil Malicki, a low-level enthusiast. I'm contributing this page to document my minimalist AOT compiler project, Zip.
== Zip ==
{{language
|name=Zip
|author=[[User:KamilMalicki|Kamil Malicki]]
|date=2024
|type=S-expression, Native AOT, Hex-emitter
|platform=x86_64 (Linux/Windows)
|turingcomplete=Yes
}}
'''Zip''' (or '''zipcc''') is a minimalist AOT-compiled language created by '''Kamil Malicki'''. It bypasses the entire modern toolchain—no LLVM, no GNU Assembler, and no linker. The compiler (written in Node.js) directly emits raw x86_64 opcodes and manually constructs binary headers (ELF/PE).
== Hardcore Specs ==
=== Raw Byte Emission ===
The compiler acts as a hex-emitter. It doesn't generate <code>.s</code> files; it pushes raw bytes into a buffer:
* '''Arithmetic:''' Maps directly to 64-bit <code>REX.W</code> prefixed opcodes.
* '''Registers:'''
** <code>r12</code>: Hardcoded as the Base Pointer for the cell-array.
** <code>rax / rbx</code>: Used for intermediate calculations and syscall arguments.
=== Binary Surgery ===
Zip is one of the few esolangs that handles OS-level ABI from scratch:
* '''Linux Backend:''' Manually builds an '''ELF64''' structure. It uses <code>sys_mmap</code> (syscall 9) to grab a 64KB page with <code>PROT_READ | PROT_WRITE</code> and executes a <code>sys_exit</code> (syscall 60) to clean up.
* '''Windows Backend:''' Forges a '''Portable Executable (PE)''' header with a <code>.text</code> section. It relies on a <code>ret</code> (0xC3) convention to return control to the OS loader, avoiding the bloat of MSVC runtimes.
=== Memory Model ===
Each cell is a strict 64-bit word. Pointer indirection is handled via nested memory syntax <code>$[ $[idx] ]</code>, which the compiler resolves into <code>mov</code> instructions with displacement.
== Instruction Set ==
{| class="wikitable"
! Syntax !! Machine Code (Example) !! Technical Effect
|-
| <code>(= $[0] 1)</code> || <code>49 C7 04 24 01 00 00 00</code> || <code>MOV QWORD [R12], 1</code>
|-
| <code>(+ a b)</code> || <code>48 01 D8</code> || <code>ADD RAX, RBX</code>
|-
| <code>(in)</code> || <code>0F 05</code> (Linux) || <code>syscall</code> for <code>sys_read</code>
|-
| <code>(repeat)</code> || <code>E9 [rel32]</code> || Native near jump for looping
|}
== Computational Class ==
Zip is [[Turing complete]]. The combination of an arbitrary-access cell array (infinite tape emulation) and <code>repeat</code> blocks with comparison flags (<code>-e</code>, <code>-ne</code>, <code>-l</code>, <code>-g</code>) satisfies the requirements for a Universal Turing Machine.
== Examples ==
=== Self-Incrementing Pointer ===
<pre>
(= $[0] 0)
(repeat (-e $[0] 100) (
(= $[ $[0] ] 255)
(= $[0] (+ $[0] 1))
))
</pre>
== Implementation ==
Created by '''Kamil Malicki'''. The toolchain is self-contained:
* '''zipcc.js''': The core logic (Lexer -> AST -> Bytecode Emitter).
* '''No external dependencies''': You only need <code>node</code> to compile; the resulting binary is 100% standalone.
== External links ==
* [https://github.com/KamilMalicki/Zip Zip Repository]
[[Category:Languages]]
[[Category:Turing complete]]
[[Category:X86-64 languages]]
[[Category:Compiled languages]]' |
Unified diff of changes made by edit (edit_diff) | '@@ -1,0 +1,72 @@
+== Introduction ==
+Hi, I'm Kamil Malicki, a low-level enthusiast. I'm contributing this page to document my minimalist AOT compiler project, Zip.
+
+== Zip ==
+{{language
+|name=Zip
+|author=[[User:KamilMalicki|Kamil Malicki]]
+|date=2024
+|type=S-expression, Native AOT, Hex-emitter
+|platform=x86_64 (Linux/Windows)
+|turingcomplete=Yes
+}}
+
+'''Zip''' (or '''zipcc''') is a minimalist AOT-compiled language created by '''Kamil Malicki'''. It bypasses the entire modern toolchain—no LLVM, no GNU Assembler, and no linker. The compiler (written in Node.js) directly emits raw x86_64 opcodes and manually constructs binary headers (ELF/PE).
+
+== Hardcore Specs ==
+
+=== Raw Byte Emission ===
+The compiler acts as a hex-emitter. It doesn't generate <code>.s</code> files; it pushes raw bytes into a buffer:
+* '''Arithmetic:''' Maps directly to 64-bit <code>REX.W</code> prefixed opcodes.
+* '''Registers:'''
+** <code>r12</code>: Hardcoded as the Base Pointer for the cell-array.
+** <code>rax / rbx</code>: Used for intermediate calculations and syscall arguments.
+
+=== Binary Surgery ===
+Zip is one of the few esolangs that handles OS-level ABI from scratch:
+* '''Linux Backend:''' Manually builds an '''ELF64''' structure. It uses <code>sys_mmap</code> (syscall 9) to grab a 64KB page with <code>PROT_READ | PROT_WRITE</code> and executes a <code>sys_exit</code> (syscall 60) to clean up.
+* '''Windows Backend:''' Forges a '''Portable Executable (PE)''' header with a <code>.text</code> section. It relies on a <code>ret</code> (0xC3) convention to return control to the OS loader, avoiding the bloat of MSVC runtimes.
+
+=== Memory Model ===
+Each cell is a strict 64-bit word. Pointer indirection is handled via nested memory syntax <code>$[ $[idx] ]</code>, which the compiler resolves into <code>mov</code> instructions with displacement.
+
+== Instruction Set ==
+
+{| class="wikitable"
+! Syntax !! Machine Code (Example) !! Technical Effect
+|-
+| <code>(= $[0] 1)</code> || <code>49 C7 04 24 01 00 00 00</code> || <code>MOV QWORD [R12], 1</code>
+|-
+| <code>(+ a b)</code> || <code>48 01 D8</code> || <code>ADD RAX, RBX</code>
+|-
+| <code>(in)</code> || <code>0F 05</code> (Linux) || <code>syscall</code> for <code>sys_read</code>
+|-
+| <code>(repeat)</code> || <code>E9 [rel32]</code> || Native near jump for looping
+|}
+
+== Computational Class ==
+Zip is [[Turing complete]]. The combination of an arbitrary-access cell array (infinite tape emulation) and <code>repeat</code> blocks with comparison flags (<code>-e</code>, <code>-ne</code>, <code>-l</code>, <code>-g</code>) satisfies the requirements for a Universal Turing Machine.
+
+== Examples ==
+
+=== Self-Incrementing Pointer ===
+<pre>
+(= $[0] 0)
+(repeat (-e $[0] 100) (
+ (= $[ $[0] ] 255)
+ (= $[0] (+ $[0] 1))
+))
+</pre>
+
+== Implementation ==
+Created by '''Kamil Malicki'''. The toolchain is self-contained:
+* '''zipcc.js''': The core logic (Lexer -> AST -> Bytecode Emitter).
+* '''No external dependencies''': You only need <code>node</code> to compile; the resulting binary is 100% standalone.
+
+== External links ==
+* [https://github.com/KamilMalicki/Zip Zip Repository]
+
+[[Category:Languages]]
+[[Category:Turing complete]]
+[[Category:X86-64 languages]]
+[[Category:Compiled languages]]
' |
Lines added in edit (added_lines) | [
0 => '== Introduction ==',
1 => 'Hi, I'm Kamil Malicki, a low-level enthusiast. I'm contributing this page to document my minimalist AOT compiler project, Zip.',
2 => '',
3 => '== Zip ==',
4 => '{{language',
5 => '|name=Zip',
6 => '|author=[[User:KamilMalicki|Kamil Malicki]]',
7 => '|date=2024',
8 => '|type=S-expression, Native AOT, Hex-emitter',
9 => '|platform=x86_64 (Linux/Windows)',
10 => '|turingcomplete=Yes',
11 => '}}',
12 => '',
13 => ''''Zip''' (or '''zipcc''') is a minimalist AOT-compiled language created by '''Kamil Malicki'''. It bypasses the entire modern toolchain—no LLVM, no GNU Assembler, and no linker. The compiler (written in Node.js) directly emits raw x86_64 opcodes and manually constructs binary headers (ELF/PE).',
14 => '',
15 => '== Hardcore Specs ==',
16 => '',
17 => '=== Raw Byte Emission ===',
18 => 'The compiler acts as a hex-emitter. It doesn't generate <code>.s</code> files; it pushes raw bytes into a buffer:',
19 => '* '''Arithmetic:''' Maps directly to 64-bit <code>REX.W</code> prefixed opcodes.',
20 => '* '''Registers:''' ',
21 => '** <code>r12</code>: Hardcoded as the Base Pointer for the cell-array.',
22 => '** <code>rax / rbx</code>: Used for intermediate calculations and syscall arguments.',
23 => '',
24 => '=== Binary Surgery ===',
25 => 'Zip is one of the few esolangs that handles OS-level ABI from scratch:',
26 => '* '''Linux Backend:''' Manually builds an '''ELF64''' structure. It uses <code>sys_mmap</code> (syscall 9) to grab a 64KB page with <code>PROT_READ | PROT_WRITE</code> and executes a <code>sys_exit</code> (syscall 60) to clean up.',
27 => '* '''Windows Backend:''' Forges a '''Portable Executable (PE)''' header with a <code>.text</code> section. It relies on a <code>ret</code> (0xC3) convention to return control to the OS loader, avoiding the bloat of MSVC runtimes.',
28 => '',
29 => '=== Memory Model ===',
30 => 'Each cell is a strict 64-bit word. Pointer indirection is handled via nested memory syntax <code>$[ $[idx] ]</code>, which the compiler resolves into <code>mov</code> instructions with displacement.',
31 => '',
32 => '== Instruction Set ==',
33 => '',
34 => '{| class="wikitable"',
35 => '! Syntax !! Machine Code (Example) !! Technical Effect',
36 => '|-',
37 => '| <code>(= $[0] 1)</code> || <code>49 C7 04 24 01 00 00 00</code> || <code>MOV QWORD [R12], 1</code>',
38 => '|-',
39 => '| <code>(+ a b)</code> || <code>48 01 D8</code> || <code>ADD RAX, RBX</code>',
40 => '|-',
41 => '| <code>(in)</code> || <code>0F 05</code> (Linux) || <code>syscall</code> for <code>sys_read</code>',
42 => '|-',
43 => '| <code>(repeat)</code> || <code>E9 [rel32]</code> || Native near jump for looping',
44 => '|}',
45 => '',
46 => '== Computational Class ==',
47 => 'Zip is [[Turing complete]]. The combination of an arbitrary-access cell array (infinite tape emulation) and <code>repeat</code> blocks with comparison flags (<code>-e</code>, <code>-ne</code>, <code>-l</code>, <code>-g</code>) satisfies the requirements for a Universal Turing Machine.',
48 => '',
49 => '== Examples ==',
50 => '',
51 => '=== Self-Incrementing Pointer ===',
52 => '<pre>',
53 => '(= $[0] 0)',
54 => '(repeat (-e $[0] 100) (',
55 => ' (= $[ $[0] ] 255)',
56 => ' (= $[0] (+ $[0] 1))',
57 => '))',
58 => '</pre>',
59 => '',
60 => '== Implementation ==',
61 => 'Created by '''Kamil Malicki'''. The toolchain is self-contained:',
62 => '* '''zipcc.js''': The core logic (Lexer -> AST -> Bytecode Emitter).',
63 => '* '''No external dependencies''': You only need <code>node</code> to compile; the resulting binary is 100% standalone.',
64 => '',
65 => '== External links ==',
66 => '* [https://github.com/KamilMalicki/Zip Zip Repository]',
67 => '',
68 => '[[Category:Languages]]',
69 => '[[Category:Turing complete]]',
70 => '[[Category:X86-64 languages]]',
71 => '[[Category:Compiled languages]]'
] |