Here’s a little blocktalk script, that shows the latest working feature I’ve added to my Blocktalk interpreter: Exception handling
Basically, it’s just a simple portscanner.
System require: "socket" host = "localhost" (ARGV at: 0) if { host = (ARGV at: 0) } open_ports = [] 1 upto: 1024 do |port| Thread new { try{ t = TCPSocket new: host port: port open_ports << port s = Socket getnameinfo: ["AF_INET", port, host] Console puts: ("\nPort #{port} (#{s[1]})" + " is open.") catch{ Console print: "." } ensure{ t if { t close } } } } end Console puts Console puts: "Open ports on #{host} are:" Console puts: (open_ports join: ", ") |
So yeah, this is actually working. Now I’ve basically have most of the language features done that I had in mind first. Next to come are probably some performance optimizations as well as some more unique features, I still have to come up with. We’ll see
Update:
I’ve added Threading to the code, this speeds up the process a little


2 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.
Not bad, not bad…but I can´t try it out right now, got to get the bus
you would also need the interpreter to actually try it out
i’ll put the code on github soon, need to clean it up a little first and add some documentation