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:
Vendored
+57
@@ -0,0 +1,57 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
import "os" for Platform, Process
|
||||
import "io" for Directory
|
||||
|
||||
class Dashboard {
|
||||
static show() {
|
||||
System.print("========================================")
|
||||
System.print(" WREN CLI SYSTEM DASHBOARD ")
|
||||
System.print("========================================")
|
||||
|
||||
System.print("PLATFORM INFO:")
|
||||
System.print(" OS Name: %(Platform.name)")
|
||||
System.print(" POSIX: %(Platform.isPosix)")
|
||||
System.print(" Home: %(Platform.homePath)")
|
||||
|
||||
System.print("\nPROCESS INFO:")
|
||||
System.print(" PID: %(Process.pid)")
|
||||
System.print(" PPID: %(Process.ppid)")
|
||||
System.print(" CWD: %(Process.cwd)")
|
||||
System.print(" Version: %(Process.version)")
|
||||
|
||||
System.print("\nARGUMENTS:")
|
||||
if (Process.arguments.count == 0) {
|
||||
System.print(" (none)")
|
||||
} else {
|
||||
for (i in 0...Process.arguments.count) {
|
||||
System.print(" [%(i)]: %(Process.arguments[i])")
|
||||
}
|
||||
}
|
||||
|
||||
System.print("\nWORKING DIRECTORY FILES:")
|
||||
var files = Directory.list(".")
|
||||
files.sort(Fn.new {|a, b|
|
||||
var ba = a.bytes
|
||||
var bb = b.bytes
|
||||
var len = ba.count < bb.count ? ba.count : bb.count
|
||||
for (i in 0...len) {
|
||||
if (ba[i] < bb[i]) return true
|
||||
if (ba[i] > bb[i]) return false
|
||||
}
|
||||
return ba.count < bb.count
|
||||
})
|
||||
|
||||
var count = 0
|
||||
for (file in files) {
|
||||
if (count > 10) {
|
||||
System.print(" ... and %(files.count - 10) more")
|
||||
break
|
||||
}
|
||||
System.print(" - %(file)")
|
||||
count = count + 1
|
||||
}
|
||||
System.print("========================================")
|
||||
}
|
||||
}
|
||||
|
||||
Dashboard.show()
|
||||
Reference in New Issue
Block a user