<wreed>
(really my friend is looking into this but i wanted to help him)
lockywolf_ has quit [Ping timeout: 245 seconds]
lockywolf__ has joined #racket
liberiga has joined #racket
lockywolf_ has joined #racket
ohama has quit [Remote host closed the connection]
lockywolf__ has quit [Ping timeout: 244 seconds]
efm has quit [Ping timeout: 245 seconds]
lockywolf__ has joined #racket
pierpal has joined #racket
lockywolf_ has quit [Ping timeout: 245 seconds]
ohama has joined #racket
libertyprime has quit [Ping timeout: 258 seconds]
dddddd has quit [Remote host closed the connection]
lockywolf_ has joined #racket
lockywolf__ has quit [Ping timeout: 246 seconds]
lockywolf_ has quit [Remote host closed the connection]
lockywolf_ has joined #racket
englishm has quit [Excess Flood]
lavaflow has joined #racket
englishm has joined #racket
lockywolf__ has joined #racket
lockywolf_ has quit [Ping timeout: 258 seconds]
<lavaflow>
I'm working on a system that creates a tcp server and receives and executes s-expressions, returning the results.
<lavaflow>
I don't want to use eval for this though because it kind of unnerves me and the namespace documentation was a bit daunting
<lavaflow>
so instead I'm matching on the input, e.g.: [`(get-file-id ,filename) (get-file-id filename)]
<lavaflow>
seems to work fine, but I'm not sure how I would match commands invoking a procedure that looks like this: (define (remove-files #:delete? [delete? #f] . file-ids) ... )
lockywolf__ has quit [Ping timeout: 245 seconds]
lockywolf__ has joined #racket
libertyprime has joined #racket
lockywolf__ has quit [Ping timeout: 272 seconds]
wreed has quit [Quit: Goodbye]
lockywolf__ has joined #racket
wreed has joined #racket
wreed has quit [Client Quit]
lockywolf_ has joined #racket
lockywolf__ has quit [Ping timeout: 272 seconds]
lockywolf_ has quit [Ping timeout: 245 seconds]
lockywolf has joined #racket
liberiga has quit [Ping timeout: 260 seconds]
lockywolf_ has joined #racket
endobson has joined #racket
lockywolf has quit [Ping timeout: 268 seconds]
lockywolf__ has joined #racket
lockywolf_ has quit [Ping timeout: 245 seconds]
lockywolf_ has joined #racket
lockywolf__ has quit [Ping timeout: 258 seconds]
lockywolf has joined #racket
lockywolf_ has quit [Ping timeout: 245 seconds]
lockywolf has quit [Ping timeout: 245 seconds]
endformationage has quit [Quit: WeeChat 2.5]
endobson has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
YuGiOhJCJ has quit [Remote host closed the connection]
YuGiOhJCJ has joined #racket
orivej has joined #racket
sagax has joined #racket
manualcrank has quit [Quit: WeeChat 1.9.1]
lockywolf has joined #racket
lockywolf has quit [Remote host closed the connection]
ubLIX has joined #racket
orivej has quit [Ping timeout: 268 seconds]
ng0 has joined #racket
YuGiOhJCJ has quit [Ping timeout: 260 seconds]
JunjieZ has quit [Read error: Connection reset by peer]
YuGiOhJCJ has joined #racket
vraid has joined #racket
orivej has joined #racket
<tonyg>
lavaflow: you're doing something interesting there. You're implicitly defining some data structures that correspond to code running on your server - you're writing an interpreter!
<tonyg>
If you don't want to go whole hog with this, and you don't care at all about security in any way, you might as well just use `eval`
<tonyg>
Otherwise, feel free to choose a syntax for the language you're defining and map it to Racket's procedure call syntax any way you like
<tonyg>
Concretely, if you're interested in parsing out function-call-like syntax, with keywords and optionals etc, I would investigate the use of match-expanders
<tonyg>
the idea is you'd write a collection of small procedures that, given a description of a function "prototype" and an input from the user, would analyze the input according to the prototype. Then you'd wrap that up in a match expander for nice sugar for you writing the interpreter
<tonyg>
gtg
ZombieChicken has quit [Remote host closed the connection]
ubLIX has quit [Quit: ubLIX]
selimcan has joined #racket
YuGiOhJCJ has quit [Remote host closed the connection]
jmiven has joined #racket
mSSM has quit [Ping timeout: 272 seconds]
atweiden-air has joined #racket
<atweiden-air>
is it possible to do something like this http://ix.io/1Tu1 in racket?
<bremner>
atweiden-air: I don't know clojure, but do you maybe want classes?
<BitPuffin>
I'm trying to use read-syntax to get s-expressions with source location
<BitPuffin>
to make a little compiler
<BitPuffin>
but when I use (read-syntax "bla.g2", input-port) I seem to only get the offset into the file as the column and no line
<BitPuffin>
so it shows like bla.g2::23
<BitPuffin>
ah!
<BitPuffin>
turns out I'm just not very smart
<BitPuffin>
I just had to do (port-count-lines! port)
Sgeo has quit [Ping timeout: 268 seconds]
vraid has joined #racket
acarrico has joined #racket
badkins has quit [Ping timeout: 258 seconds]
sz0 has joined #racket
libertyprime has quit [Quit: leaving]
FreeFull has joined #racket
ziyourenxiang has quit [Ping timeout: 246 seconds]
orivej has joined #racket
badkins has joined #racket
pera has joined #racket
soegaard has joined #racket
orivej has quit [Ping timeout: 245 seconds]
lockywolf has joined #racket
lockywolf has quit [Remote host closed the connection]
lockywolf has joined #racket
ubLIX has joined #racket
orivej has joined #racket
manualcrank has joined #racket
efm has joined #racket
efm has quit [Client Quit]
ng0 has quit [Quit: Alexa, when is the end of world?]
mceier has quit [Ping timeout: 248 seconds]
mceier has joined #racket
pie_ has quit [Ping timeout: 264 seconds]
ng0 has joined #racket
<lavaflow>
tonyg: thanks for the feedback
<lavaflow>
I've dabbled in macro-expanders a bit before, I'll take a stab at using them for this
<lavaflow>
although I'm thinking now that maybe using eval is the right choice. I just need to figure out how to create a good namespace to use for it
<lavaflow>
I'd rather not permit all of racket/base, but (make-empty-namespace) seems to be *too* empty since I guess that doesn't include some macro that handles function application or something like that?
<lavaflow>
or maybe racket/base is fine.. I need to figure out what all is in it.
<rain1>
lavaflow: it's simple to make a basic interpreter for variables and function application: your interpreter function would recursively do this: symbol? x ==> lookup the value of x. list? x ==> (apply (interpret (car x)) (map interpret (cdr x)))
<lavaflow>
hmm, I guess I don't need to match all the args explicitly at all do I
<rain1>
the application of a procedure will perform arg matching
ng0 has quit [Write error: Connection reset by peer]
cantstanya has quit [Read error: Connection reset by peer]
<lavaflow>
eventually I'd like to perform some of my own optimizations before evaling it, since for example `(reverse (tags jpg))` would normally do a sql query in tags, then reverse the result in sql, but if I can roll that reverse up into the sql query it's a lot more performant.
<lavaflow>
but I could add in that step later I guess
<lavaflow>
*then reverse the result in racket
cantstanya has joined #racket
ng0 has joined #racket
sauvin has quit [Read error: Connection reset by peer]
ng0 has quit [Quit: Alexa, when is the end of world?]
jao has quit [Ping timeout: 245 seconds]
ng0 has joined #racket
rclayton_ has joined #racket
endobson has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rushsteve1 has joined #racket
badkins has quit [Ping timeout: 272 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
selimcan has quit [Ping timeout: 245 seconds]
sagax has quit [Ping timeout: 272 seconds]
endformationage has quit [Read error: Connection reset by peer]
sagax has joined #racket
endformationage has joined #racket
thawesWork has quit [Ping timeout: 245 seconds]
pie_ has joined #racket
dumptruckman has joined #racket
badkins has joined #racket
<tonyg>
lavaflow: yeah `eval` is definitely a security nightmare, plus as you say there's all the advantages you get of being able to do symbolic manipulations of the input when you have control over the whole language.
<tonyg>
(and when it's a very restricted language)
<dzoe>
What would be the "best" way to simulate recursion using custom-defined stacks?
<dzoe>
While trying to parallelize an algorithm (merge sort actually), it turns out, that recursion allocates too much memory and that is not future-safe operation.
<dzoe>
Currently I am pondering the possibility of simulating the recursion using vectors/fxvectors.
<dzoe>
Problem is, I need to perform some work before each recursive call and _after_ as well.
<dzoe>
(The latter part gives me headache right now)
jao has joined #racket
rclayton_ has quit [Remote host closed the connection]
liberiga has joined #racket
efm has joined #racket
ng0 has quit [Quit: Alexa, when is the end of world?]
ng0 has joined #racket
ubLIX has quit [Quit: ubLIX]
atweiden-air has quit [Quit: leaving]
<gluon>
is there any easy way to get a datetime delta in gregor-lib? i mean subtracting two datetimes and getting the number of years, months, days, hours, etc between them?