feat: add networking module with TCP Socket/Server and example applications

Implement a full-featured `net` module supporting TCP `Socket` and `Server` classes via libuv, including example applications (chat server, echo server, HTTP client/server, file explorer, system dashboard) and benchmark scripts (fibonacci, n-body). Add GEMINI.md project documentation and Stderr class to io module.
This commit is contained in:
2026-01-24 08:57:59 +00:00
parent abc32676bf
commit 8f1d13a86b
25 changed files with 1371 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
import "net" for Server
import "scheduler" for Scheduler
var port = 9090
var server = Server.bind("0.0.0.0", port)
System.print("Echo Server running on port %(port)")
while (true) {
var socket = server.accept()
System.print("New connection accepted")
Fiber.new {
var socket_ = socket // Capture variable
while (true) {
var data = socket_.read()
if (data == null) {
break
}
System.print("Received: %(data.count) bytes")
socket_.write(data)
}
System.print("Connection closed")
socket_.close()
}.call()
}