3 ms·
> Scheme > the rest of my userland One of the reasons I eventually got fed up with Scheme is that interfacing it with the rest of my userland was really quite
by saywatnow 10y ago
> Scheme
> the rest of my userland
One of the reasons I eventually got fed up with Scheme is that interfacing it with the rest of my userland was really quite hard. IO, subprocesses, networking just weren't as smooth as Unix wanted them to be. Everything had to be wrapped in lists before the "big ball of snow" could do magic with it.
Later I discovered Tcl. upvar and uplevel are not syntax-rules or defmacro, but they give you very similar power in practice - I won't say more or less arcane, just different. IO, events and subprocess management are all right there. Best of all, EIAS (everything is a string) makes communicating with the outside world as natural as it should be.
It helps that Tcl got tailcall and lambda shortly after I arrived :).
- TeMPOraL 10y ago> upvar and uplevel are not syntax-rules or defmacro, but they give you very similar power in practice - I won't say more or less arcane, just different. IO, events and subprocess management are all right there. Makes me wonder if one could port those Tcl features to Scheme / CL via the macro facility, thus having the cake and eating it too?
- saywatnow 10y agoUnfortunately, no. At least not with anything resembling R6RS scheme. upvar/uplevel give you dynamic access to the calling context, which is at odds with scheme's insistence that compilation must be possible, including the erasure of all names. Tcl is at the other extreme: everything is late-bound, (very nearly) everything is introspectable. It is possible to go the other way though ... [1] doesn't go as far as macros, but (provided you don't believe in compile-time/run-time separation) upvar/uplevel could take it there! No call/cc is possible in Tcl, but coroutines can express more limited forms of continuations. And when Oleg calls out call/cc as a poor primitive, I'm comfortable giving it up :). [1]: https://wiki.tcl.tk/22049 https://wiki.tcl.tk/22049