<ousado>
Drup: yes, that's also very close to what I'm doing
<ousado>
but it also lacks certain features that i think are crucial. It has lots of features I don't support, though
<adrien>
Drup: slightly overkill :P
<adrien>
ousado: that's the next step
testcocoon has joined #ocaml
<adrien>
I had a good occasion to learn JS so I did
<adrien>
I'll probably try to see how the same stuff looks in js_of_ocaml
<ousado>
ah yes, one should be familiar with it,
<adrien>
and how the output looks too
testcocoon has quit [Quit: Coyote finally caught me]
<ousado>
it still lacks TCO, as far as I'm aware
troydm has quit [Read error: Operation timed out]
<Drup>
TCO ?
<ousado>
I'm checking out the ppx stuff as a first step to the rewrite in ocaml
<ousado>
tail call optimization
<Drup>
oh, there is "simple" tco in js_of_ocaml
<ousado>
I think js_of_ocaml has issues with that, last time I spoke to dsheets about it anyway
troydm has joined #ocaml
<ousado>
ah ok, yes.
<Drup>
I mean, the trivial one, with a single recursive function
<dsheets>
self recursion gets made to a loop
<Drup>
there is a problem with mutually recursive functions, that doesn't work.
<dsheets>
cps and state machines burn stack
<ousado>
ppx is really cool
<ousado>
it's just intimidating how many flavours of types there are
testcocoon has joined #ocaml
<ousado>
the haskell guys did something about TCO for one of the JS generators
<ousado>
I don't remember anything about it, though, and I don't know whether it would help in case of js_of_ocaml
beckerb has quit [Quit: Konversation terminated!]
malo has quit [Ping timeout: 276 seconds]
<rgrinberg>
is there a need for sharing constraints now that we have destructive substitions?
so has joined #ocaml
<so>
jobs
malo has joined #ocaml
Kakadu has quit [Remote host closed the connection]
Kakadu has joined #ocaml
Yoric has joined #ocaml
wwilly has quit [Quit: This computer has gone to sleep]
malc__ has quit [Quit: leaving]
Kakadu has quit [Ping timeout: 264 seconds]
<adrien>
I had an issue with something in JS and ended up checking the specification for the "&&" operator
<adrien>
for (expr1) && (expr2): Returns expr1 if it can be converted to false; otherwise, returns expr2. Thus, when used with Boolean values, && returns true if both operands are true; otherwise, returns false.
<adrien>
and now I'm wondering if I'm the only one to find that awful
<adrien>
of course, now that I've sent that message I can find reasons to do it that way but I still find it's very dangerous
fraggle_ has quit [Ping timeout: 245 seconds]
<Drup>
adrien: it's absolutely horrible. You can find it every 10 lines of code in every big JS library.
<adrien>
yuk =/
<Drup>
I don't even want to talk about how to debug this kind of things.
testcocoon has quit [Quit: Coyote finally caught me]
yacks has joined #ocaml
testcocoon has joined #ocaml
<ousado>
adrien: what exactly do you find dangerous about it?
testcocoon has quit [Quit: Coyote finally caught me]
<ousado>
adrien: that it doesn't always return booleans?
<ggole>
adrien: it's common in Lisp-family languages
<ggole>
Doesn't seem particularly error-prone there
<ggole>
(Not more than the rest of Lisp, anyway)
ttamttam has left #ocaml []
testcocoon has joined #ocaml
Snark has quit [Quit: leaving]
raichoo has joined #ocaml
emmanuelux has quit [Ping timeout: 256 seconds]
<wmeyer>
ousado: yes, opam now is pretty much a standard
emmanuelux has joined #ocaml
PM has quit [Ping timeout: 246 seconds]
Tobu has quit [Ping timeout: 264 seconds]
<ousado>
wmeyer: ok, very nice.
<ousado>
any pointers which libraries I should look at for binary IO?
Tobu has joined #ocaml
<ousado>
Extlib.IO seems to be a candidate
tane has quit [Quit: Verlassend]
<wmeyer>
ousado: I don't know libraries for binary IO, but Extlib would work I think
q66_ has joined #ocaml
q66 has quit [Ping timeout: 240 seconds]
ggole has quit [Ping timeout: 246 seconds]
Tobu has quit [Quit: No Ping reply in 180 seconds.]
Tobu has joined #ocaml
Neros has quit [Remote host closed the connection]
Kakadu has quit []
Neros has joined #ocaml
<adrien>
ousado: I don't find it dangerous per se, but I find it at best weird that && returns something else than a boolean
<thizanne>
it allows ternaries in python !
<thizanne>
(well it did before real ones)
raichoo has quit [Quit: leaving]
<Drup>
I find it weirder that it allow "that" to be something else that a boolean, in fact
<Drup>
than*
<ousado>
adrien: ok, then I get the point, I just wasn't sure what you mean
<ousado>
and I agree, it's useless and invites hacks
<ousado>
I also don't really understand why one would do it that way, since it might lead to repeated coercions
q66_ is now known as q66
<adrien>
well I think it somehow matches the language
<Drup>
ousado: Javascript is a lot of things, but if there is two thing it is not, that's type safe and efficient, and it was never designed to be that.
<adrien>
and you can do: var first_true_object = obj1 || obj2 || obj3 || ...;
<adrien>
but I'm not sure when that would be useful :-)
<Drup>
adrien: hey, you can simulate optional argument with that !
<ousado>
Drup: well, the "efficient" part is not true anymore
<Drup>
ousado: you're talking about asm.js ?
<adrien>
ousado: well, the language itself isn't very efficient; it has sunk millions and millions of dollars to get a bit fast
<adrien>
(it's probably getting close to 100 millions)
<Drup>
js is "not too slow" for a script langage, it's still not "fast" :x
* nicoo
compiles Drup to NaCl. (Google's « ASM for the web » thingie)
<adrien>
poor NaCl! (yes, "NaCl" tab-completes on this channel ;p )
<ousado>
Drup: have you seen the "Breaking the JavaScript Speed Limit with V8" presentation?
testcocoon has quit [Quit: Coyote finally caught me]
<adrien>
...
<adrien>
their first C++ code uses the "volatile" keyword and I really doubt it's useful there
Watcher7|off is now known as Watcher7
jkl has joined #ocaml
<Drup>
ousado: interesting, there is awful lot of assumption on the js code to be optimized and I'm not sure C++ is the good langage to compare.
testcocoon has joined #ocaml
<ousado>
sure, but still, it's quite an impressive result. it was to me at least. And the major takeaway is that te best you can do is write typesafe JS - IOW use a good language and compile to JS
testcocoon has quit [Quit: Coyote finally caught me]
Yoric has quit [Ping timeout: 248 seconds]
<Drup>
ousado: Basically, they are asking for people to restrict themself to a language that's easily typeable and compilable.
<ousado>
yes
eikke has quit [Ping timeout: 252 seconds]
<Drup>
pypy is doing kinda the same, and perfs are indeed impressive, but that's not js anymore, that's a smaller language. And you still don't have a typechecker to help you debug.
<ousado>
yes.. but I see JS more as an intermediate representation anyway
<ousado>
and I'm glad that there is a common denominator now.
<ousado>
as in "if it's scriptable at all, it probably is scriptable in JS"
eikke has joined #ocaml
eni has joined #ocaml
testcocoon has joined #ocaml
<ousado>
interoperability and code-reuse are huge benefits
ollehar has joined #ocaml
jbrown has quit [Ping timeout: 256 seconds]
gasche has quit [Ping timeout: 252 seconds]
gasche has joined #ocaml
PM has joined #ocaml
q66 has quit [Remote host closed the connection]
malo has quit [Quit: Leaving]
testcocoon has quit [Quit: Coyote finally caught me]
<NaCl>
adrien: !!
<bernardofpc>
interesting that Dijkstra uses also primes numbers in his structured programming manifesto EWD249