10
typosaurus
135d

Today was not my sharpest day but managed to sit eight hours on this chair with a laptop on my arm leaning. It's very comfortable.

I made a regex interpreter. Three versions, the first one was nicely programmed and functional but found out that it was 16 times slower than the clib one (at least!). Then i found out how extremely fast the clib one was and found out that the compiling to bytecode what they do is extremely effective. So, i've wrote my one bytecode compiler that is faster than theirs. So, the second version was born. After abusing that thing to find out what kinda speeds i could get out of it, it became very unmaintainable, beyond resque. So i made third version, this one is very performant. It supports [abc]{3} (three times dupplicating group) for example. It supports 0-9 and a-z that converts to 'd' and 'a' (shorter for speed). It converts [a0-9a-z]]{3} to [lada][lada][lada]. The bytecode is not smaller many times than source, but not having to think, suits the interpreter very well. It's blazing fast.

I wish I could smth like this for a living. Develop a language for a living or socket servers. Tired of python (great language, but boring).

Thanks for listening to my tedtalk

Comments
  • 1
    So cool!
  • 1
    Well, if you want to have the same kind of low level thrill and work with networking, you can always have a look at koll###21##4###n#n#nu#n#nuuuuu##!#
  • 1
    @CoreFusionX recently played with networking. Made a game server with libuv (node's async engine). The playground was an ascii grid. The clients could send direction(up,down,left,right) and the server would apply that and update the game screen. It ran 500 clients constant updating easily. It was very trippy. I had the idea of tsoding who also did smth like that, but with a web interface. I don't build a web interface for fun. libuv is nice stuff, their networking interface is clean. It works with events like on_connect, on_accept, on_close that get cycled by the aioloop. Not threaded
  • 0
    @AmyShackles thanks. You're good with regexes huh? I just started, i could never remember it somehow but i think now it won't be an issue anymore
  • 0
    Have you ever used a language like erlang, with pattern matching? What'd you think of the feature if so?
Add Comment