feat: implement Linux x86_64 syscall suite and networking stdlib modules #276
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR transforms Wave into a systems-level programming language by implementing a comprehensive Linux x86_64 system interface. It includes a full suite of syscall wrappers, low-level memory/file-system management, and high-level networking abstractions for TCP and UDP.
Key Changes
1. Lexer & Frontend Enhancements
\xHHescape sequences in string literals, enabling the inclusion of raw binary data within strings.skip_triviamethod, improving the robustness of tokenization across complex multi-line comments.inputstatement into the parser and fixedscanfmapping to correctly handle 8-bit integers as characters (%c).2. Backend & Type System Improvements
PointerandInt64types specifically for functions prefixed withsyscall. This facilitates the passing of raw memory addresses directly to system registers without manual casting.rax,rdi,rsi,rdx,r10,r8,r9).3. Standard Library:
std::sys::linuxsyscall0throughsyscall6using inline assembly.fs): Added raw wrappers foropen,read,write,close,lseek, andstat.mmap,munmap, andbrkfor manual control over virtual memory and heap allocation.nanosleep,clock_gettime, and a full set of socket constants and API wrappers (AF_INET, SOCK_STREAM, etc.).4. Standard Library:
std::netBuilt upon the raw syscalls, these modules provide ergonomic, synchronous networking:
tcp: High-levelTcpListenerandTcpStreamfor reliable stream-based communication.udp:UdpSocketfor datagram-based network logic.