flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
avsm1 has quit [Quit: Leaving.]
pzv has joined #ocaml
vpit3833 has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
Simn has quit [Quit: Leaving]
Derander has quit [Quit: ZNC - http://znc.sourceforge.net]
mye has quit [Quit: mye]
jpdeplaix has quit [Ping timeout: 245 seconds]
csakatoku has joined #ocaml
introom has joined #ocaml
watermind has quit [Quit: Konversation terminated!]
darkf has joined #ocaml
yacks has quit [Ping timeout: 246 seconds]
<osa1> what is dot syntax in this type declaration `type 'a return = { return : 'b . 'a -> 'b }' ?
jpdeplaix has joined #ocaml
avsm1 has joined #ocaml
avsm1 has quit [Ping timeout: 268 seconds]
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
dsheets has quit [Ping timeout: 245 seconds]
Neros has quit [Ping timeout: 245 seconds]
osa1 has quit [Ping timeout: 256 seconds]
pzv has quit [Ping timeout: 246 seconds]
ollehar has quit [Ping timeout: 264 seconds]
q66 has quit [Quit: Leaving]
ygrek has joined #ocaml
Drup has quit [Quit: Leaving.]
amiller has quit [Quit: ZNC - http://znc.sourceforge.net]
pzv has joined #ocaml
Guest33775 has joined #ocaml
palomer has joined #ocaml
shinnya has quit [Ping timeout: 264 seconds]
palomer has quit [Ping timeout: 248 seconds]
ben_zen has joined #ocaml
whitequark has quit [Remote host closed the connection]
introom has quit [Remote host closed the connection]
ggole has joined #ocaml
avsm1 has joined #ocaml
bondar has quit [Read error: Connection reset by peer]
mcclurmc has joined #ocaml
ben_zen has quit [Quit: Whee!]
ygrek has quit [Ping timeout: 264 seconds]
<adrien> urgh
ben_zen has joined #ocaml
<adrien> avsm1: btw, remember that Gerd has sometimes weird ways of talking
<adrien> same applies (in worse) with russians btw
djcoin has joined #ocaml
ttamttam has joined #ocaml
<orbitz> Gerd makes it hard to sympathize with his situation
introom has joined #ocaml
Guest33775 is now known as amiller
amiller has quit [Changing host]
amiller has joined #ocaml
csakatok_ has joined #ocaml
csakatoku has quit [Ping timeout: 248 seconds]
avsm1 has quit [Quit: Leaving.]
ygrek has joined #ocaml
ben_zen has quit [Quit: sleep]
whitequark has joined #ocaml
pzv has quit [Read error: Connection reset by peer]
pzv has joined #ocaml
TaXules_ has quit [Read error: Connection reset by peer]
thomasga has joined #ocaml
mika1 has joined #ocaml
cago has joined #ocaml
gnuvince has quit [Ping timeout: 276 seconds]
Simn has joined #ocaml
beckerb has joined #ocaml
ontologiae_ has joined #ocaml
ulfdoz has joined #ocaml
thomasga has quit [Ping timeout: 276 seconds]
thomasga has joined #ocaml
ttamttam has quit [Ping timeout: 276 seconds]
zpe has joined #ocaml
rixed has joined #ocaml
mcclurmc has quit [Quit: Leaving.]
zpe has quit [Remote host closed the connection]
ulfdoz has quit [Ping timeout: 248 seconds]
pzv has quit [Ping timeout: 264 seconds]
eikke has joined #ocaml
ollehar has joined #ocaml
mcclurmc has joined #ocaml
<eikke> is there any lib like the Digest module which has 'update' support?
<mrvn> so you can feed it data a chunk at a time?
gnuvince has joined #ocaml
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
<eikke> hmh, thanks
gnuvince has quit [Ping timeout: 256 seconds]
<mrvn> check if batteries has something included or use the patches.
pzv has joined #ocaml
<compnaion_cbue> there is cryptokit too
dsheets has joined #ocaml
tynant has joined #ocaml
tynant has quit [Client Quit]
ulfdoz has joined #ocaml
q66 has joined #ocaml
ttamttam has joined #ocaml
<eikke> compnaion_cbue: that looks interesting, thanks
<eikke> mrvn: we rather don't enforce patched compilers on customers :)
<compnaion_cbue> eikke: also, it provides more powerful hashes than md5
<eikke> compnaion_cbue: I was hoping not to require a dependency :) and the use case is trusted-source data validation, so md5 would've been OK
<compnaion_cbue> I see
<eikke> when using cryptokit we could as well go for a stornger hash indeed
PM has quit [*.net *.split]
brendan has quit [*.net *.split]
j0sh has quit [*.net *.split]
brendan has joined #ocaml
j0sh has joined #ocaml
PM has joined #ocaml
Drup has joined #ocaml
_andre has joined #ocaml
<mrvn> eikke: I would have build it as extra module, like Digest_plus or something.
<eikke> mrvn: patch needs C-level changes, so it's not *that* simple :)
<mrvn> Given that md5 is vulnerable to prefix attacks I wonder if one could an ocaml module that ends up having the same md5sum with different content.
<mrvn> eikke: did it? Wasn't the C stuff only for bigarray support? Long time since I wrote that.
<mrvn> +write
ulfdoz has quit [Ping timeout: 256 seconds]
hyperboreean has quit [Ping timeout: 246 seconds]
hyperboreean has joined #ocaml
mye has joined #ocaml
csakatok_ has quit [Remote host closed the connection]
oriba has joined #ocaml
<flux> mrvn, obviously yes, but it's not a security measure in ocaml, rather to prevent from accidents..
<flux> (on second thought I'm not sure if it does a more accurate comparison after finding a matching hash, but I suppose not)
thomasga1 has joined #ocaml
thomasga has quit [Read error: Connection reset by peer]
thomasga has joined #ocaml
thomasga1 has quit [Read error: Connection reset by peer]
Neros has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
amirmc has joined #ocaml
osa1 has joined #ocaml
introom has quit [Remote host closed the connection]
gal_bolle has joined #ocaml
amirmc has quit [Quit: Leaving.]
amirmc has joined #ocaml
ttamttam has quit [Read error: Connection reset by peer]
ttamttam has joined #ocaml
ttamttam has quit [Read error: Connection reset by peer]
ttamttam has joined #ocaml
Simn has quit [Quit: Leaving]
amirmc has quit [Quit: Leaving.]
amirmc has joined #ocaml
ygrek has joined #ocaml
introom has joined #ocaml
Nahra_ has quit [Quit: leaving]
Nahra has joined #ocaml
Nahra has quit [Changing host]
Nahra has joined #ocaml
Simn has joined #ocaml
gnuvince has joined #ocaml
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
palomer has joined #ocaml
tane has joined #ocaml
ulfdoz has joined #ocaml
darkf has quit [Quit: Leaving]
oriba has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
palomer has quit [Ping timeout: 256 seconds]
introom has quit [Remote host closed the connection]
beckerb has quit [Ping timeout: 245 seconds]
ulfdoz has quit [Ping timeout: 248 seconds]
contempt has quit [Ping timeout: 240 seconds]
contempt has joined #ocaml
mathieui has quit [Ping timeout: 245 seconds]
ulfdoz has joined #ocaml
mathieui has joined #ocaml
cago has left #ocaml []
mika1 has quit [Quit: Leaving.]
palomer has joined #ocaml
_habnabit has quit [Quit: ZNC - http://znc.sourceforge.net]
_habnabit has joined #ocaml
amirmc has quit [Quit: Leaving.]
mcclurmc has quit [Quit: Leaving.]
amirmc has joined #ocaml
tumblebolt has joined #ocaml
leroux has joined #ocaml
<tumblebolt> hey does anyone know why some unix functions aren't being found by my utop?
<tumblebolt> let goog = gethostbyaddr "http://www.google.com";; => Error: Unbound value gethostbyaddr
<Drup> tumblebolt: did you do "#require "unix" ;;" ?
<tumblebolt> yup
<Drup> Unix.gethostbyaddr is found in my system
<adrien_oww> "Unix." missing?
<adrien_oww> also, this is not going to work
<adrien_oww> "http://" makes no sense in this context
<tumblebolt> nope, other Unix. stuff is there
<tumblebolt> e.g., Unix.socket ... works
<adrien_oww> stripping it out would require parsing
thomasga has quit [Quit: Leaving.]
<leroux> Is Unix.gethostbyname missing from 4.01.0dev+trunk?
<tumblebolt> ok, sure -- more concerned about why the function itself is not found
<adrien_oww> also, the function is marked obsolete now
<tumblebolt> oh really? is http://caml.inria.fr/pub/docs/manual-ocaml/libref/Unix.html not up to date then?
<rixed> tumblebolt: gethostbyaddr and gethostbyname are found in my 4.01.0 (not trunk)
<adrien_oww> it should be there, yeah; not sure why it isn't
<tumblebolt> hm ok. will swtich back to 4.00.1 and let you know if that works
<ggole> 4.00.1 has it (at least here)
<leroux> ggole: Yeah, just switched.
<ggole> You should really be using the modern functions instead
<leroux> ggole: What would you use instead?
<leroux> Are there any up-to-date docs up?
<ggole> getaddrinfo
palomer has quit [Ping timeout: 248 seconds]
<ggole> leroux: there's a good guide to systems programming in ocaml that you should check out
<leroux> Ah, okay, thanks.
<ggole> It goes into using the Unix stuff in detail.
djcoin has quit [Quit: WeeChat 0.4.0]
<ggole> ocamlunix.forge.ocamlcore.org
ttamttam has quit [Quit: ttamttam]
<tumblebolt> ggole, that's the guide that told us to use gethostbyaddr
<ggole> (Although it suggests those obsolete functions: a shame)
<ggole> Right
<leroux> Yeah...
<tumblebolt> 4.00.1 works for me too
amirmc has quit [Quit: Leaving.]
<mrvn> Is gethostbyname still there?
levi has quit [Read error: Connection reset by peer]
gnuvince has quit [Ping timeout: 264 seconds]
levi has joined #ocaml
pr has quit [Ping timeout: 245 seconds]
amirmc has joined #ocaml
<tumblebolt> yup, mrvn, gethostbyname is there
demonimin has quit [Read error: Connection reset by peer]
demonimin has joined #ocaml
metasyntax has joined #ocaml
demonimin has quit [Changing host]
demonimin has joined #ocaml
shinnya has joined #ocaml
palomer has joined #ocaml
eikke has quit [Ping timeout: 264 seconds]
mrvn has left #ocaml []
mrvn has joined #ocaml
<mrvn> If I model the game universe by the rules of the game a unit could be in 2 or more places at once. Should I realy do that?
<pippijn> what rules?
mcclurmc has joined #ocaml
<mrvn> Mainly that the speed of light holds. So anything happening is reported to the player with a time delay according to the distance of the event. And reports need to travel from colony to colony because you can't message too far.
<mrvn> Ships between stars can be seen and reported from multiple colonies with different delays so you get multiple sightings at different positions.
<pippijn> right
<pippijn> you should do that :)
<pippijn> I'm not sure how to do that in an efficient way
<mrvn> On the other hand I could say ships are too small to be seen and don't have powerfull enough transmitters to broadcast their location. Only the 2 colonies allong the flight path would see the exhaust.
ontologiae_ has quit [Ping timeout: 276 seconds]
<tumblebolt> i'm trying to re-write ping in ocaml. does anyone have a suggestion on how to represent the icmp packet?
<mrvn> pippijn: I have another fun problem. Say you have colonies A-B-C and you send an oder to C via B. That takes say 20 years (see speed of light :) and after 7 years the enemy destroys B. Now how will C get its orders?
<tumblebolt> should i be using a record with strings as the entries?
<mrvn> tumblebolt: string
<mrvn> oh, you mean when you parse it?
<tumblebolt> mrvn: is there a way to specify the string should only be so long?
<mrvn> strings are always fixed length
<ggole> Make an abstract type and only construct them of that length
<tumblebolt> cool, thanks, i'll do that ggole
<pippijn> mrvn: I don't know your game mechanics, but I would say: not at all
<mrvn> tumblebolt: extlinux has functions for extracting and setting values in strings or bigarrays with endian conversion. You probably want to use that.
<mrvn> pippijn: hehe. There could be a longer way A-D-E-F-C. I decided to use viral propagation. Every message is send to every other colony in reach unless it is a duplicate. Now the problem is: How do I detect that a message can't be delivered in a timely manner?
<ggole> Hmm, looking at the description on wiki it seems as if you could represent it nicely as a record and some suitable types
<mrvn> type and code as variant. checksum as int32.
<mrvn> internal only I guess
<ggole> And the data as a variant too
leroux has left #ocaml []
<mrvn> data could be anything
<ggole> According to wiki there are some expected formats
<mrvn> so type data = Known_data of whatever | Unknown of string
<ggole> So you would have types for those or Uknown of ... yeah
<pippijn> how many dimensions does your universe have?
<mrvn> pippijn: 2. maybe a shallow 3rd.
leroux has joined #ocaml
leroux has left #ocaml []
<pippijn> ok, so where are these colonies positioned?
<mrvn> pippijn: randomly in a rectangle shape
<mrvn> pippijn: specifically stars are randomly placed on the map and you have a home system. Then you colonize.
<pippijn> ok, so at the beginning you have one guy who starts off at a star
<pippijn> and then you can move out to colonise other stars
<mrvn> N guys, each at a star
<pippijn> where do orders originate from?
<mrvn> multiplayer or ai
<mrvn> the home system
<pippijn> ok
<pippijn> when the home system is destroyed, you're game over?
<mrvn> Yeah. Not sure if I want to allow moving it. That would totaly screw up the time delays.
osa1 has quit [Ping timeout: 268 seconds]
<pippijn> ok
<mrvn> Maybe you can move to another star but then you are offline for the time the trip takes.
<pippijn> ok, so now if I want to give orders to C
<pippijn> no, I mean D
<pippijn> do I have to go via B and C?
<mrvn> C would probably still be in reach of A. So A-C-D
<pippijn> ah, so it's about transmitter distance
<dsheets> module A : sig type t module B : sig type t val conv : t -> A.t end end <-- Can the type of conv be written with this structure? This syntax does not work.
<mrvn> Yeah. Dust in the vacuum and simple dispersion lessening the signal.
<pippijn> are messages directed?
<pippijn> ok, so they are not
<mrvn> dsheets: no. module B : sig type t' = t type t val conv : t -> t' end
<pippijn> they are propagated in all directions?
<dsheets> mrvn, this make my interface uglier :-( but it guess it's ok
<mrvn> pippijn: technically I would say directed. But I'm sending message to all reachable stars so they appear broadcast
<dsheets> thanks
<pippijn> ok
<pippijn> you can give the messages a time to live
<mrvn> pippijn: sure. But reporting back that it arrives takes as long on the way back again. :)
<pippijn> why does the origin need to know that it arrived?
<mrvn> pippijn: The player might want to know when it can't arrive anymore
<mrvn> or when it will arrive late
ulfdoz has quit [Ping timeout: 268 seconds]
<mrvn> pippijn: If I have such a loop you can cut my communication and messages have to take the long way around. With orders times to execute at certain times that could ruin things.
<pippijn> hm, yes
<pippijn> so to get to I, the message needs to go all the way around
<mrvn> yep. With viral propagation that happens automatically.
<pippijn> right
<pippijn> hmm
pr has joined #ocaml
<mrvn> The fun thing (I hope) is that you attacking "pip E" generates a message that goes to J and then to me. So I only notice that years later. Then it takes me ages to send orders to I to attack "pip E" with the fleet thats there.
<pippijn> right, so ack should be returned
ygrek has quit [Ping timeout: 246 seconds]
<mrvn> pippijn: Or say I want to attack "pip C" from I, H and G. Then I have to send out orders to I first, H second and G last (or set their execution date accordingly) so the ships arrive at "pip C" at the same time.
<mrvn> I will have to see how much of that will be left to the user or the software.
<pippijn> are moving ships simulated?
<pippijn> i.e. can an enemy intercept moving ships?
amirmc has quit [Quit: Leaving.]
<mrvn> yes. At least your own ships or enemies in detection range. You know when your own ships launch and where they go. So they should be shown.
tumblebolt has quit [Ping timeout: 246 seconds]
<mrvn> oh, no. I don't think I will allow interceptions
<mrvn> Think about it. The ships are moving with 10-30% the speed of light or so in opposite directions. Took them a year to accelerate to that speed and they have just enough fuel to slow down at the end. They will just flash by so fast.
<pippijn> ok, yeah
<mrvn> And if they accelerated just a bit off the true course they will be millions and millions of miles apart.
<pippijn> right
osa1 has joined #ocaml
<mrvn> Maybe I will allow a single shot slavo for passing ships, destroy a few on each side. But not sure that makes much sense.
<mrvn> In the real world if you could get the ships near enough and a month before the meeting you throw a few buckets of sand of the airlock all the ships should blow up from a few grains impacting at 20-60% (combined velocity) the speed of light.
<pippijn> if you're going frontal, yes
<pippijn> you see the green arrow?
<mrvn> yep
<pippijn> pipE could send interceptors to any point on that route
smondet has quit [Remote host closed the connection]
<pippijn> and it can calculate the meeting point if the ships from home mrvn have constant speed
<mrvn> nope. By the time A gets the message of my ships launching they will be past pip E :)
<mrvn> but go on
<pippijn> 10-30% light speed
<pippijn> and they need a year to accelerate to that speed
<mrvn> pippijn: As I see it space is huge, frigging HUGE. So any slight variation in direction or acceleration will build up to a huge uncertainty. So actually hitting the other ship is hard.
<mrvn> add some random variation every week and the ships should be hard to predict.
<pippijn> anyway, I was thinking E could detect the ships as they are flying
<mrvn> Maybe, maybe not. Havent't decided what the detection range for ships not aimed at you is.
<pippijn> ok
<pippijn> well, one could expect the ships to be attracted by J's gravitational field
dsheets has quit [Ping timeout: 256 seconds]
<pippijn> so they actually fly in a curve
<mrvn> like that?
<mrvn> nah, wrong way.
<pippijn> no
<pippijn> the other way
<pippijn> something like this
<pippijn> and E also attracts it
<pippijn> actually every star in the system attracts it
<mrvn> yeah. but a) I thing the effect is miniscule and b) I'm way to lazy to compute that.
<pippijn> gravitation weakens over distance but is never gone
<pippijn> ok
<pippijn> I think that's not so difficult to compute, if you assume that every star is equal in size
smondet has joined #ocaml
<pippijn> actually it was just me thinking about how to justify the impossibility of an interception
<mrvn> Oh yeah, for that it certainyl makes a difference. Just not sure if that will be even one pixel diviation on screen.
<pippijn> I think the effect is noticable
<pippijn> you know they use the moon's gravitational field to accelerate spacecrafts flying to mars
<mrvn> A warship will also avoid broadcasting its location. If they accelerate at start all the light from the exhaust will go backwards and can't be seen by "pip B". Then they coast at max speed and are invisible to everyone. And last they break and "pip B" will get a huge flare from the exhaust.
<pippijn> right
<mrvn> pippijn: They fly a few thousand miles above it. Not a lightyear or so. :)
<pippijn> that's true
<pippijn> and you're not living on black holes
<pippijn> do you live on planets?
<mrvn> When I get everything working I can add black holes and nebula.
<pippijn> black holes are so interesting
<pippijn> I love reading about them
<mrvn> Undecided in v1.0
<mrvn> Eventually I want to have planets, asteroid belts, moons. And have buildings you can build and research advancements for faster ships or better weapons and such. But that is all for the future.
<Drup> mrvn: what sort of game are you building exactly ?
<mrvn> Drup: a bit like Master of Orion but with lightspeed limiting observations and orders.
<pippijn> eve online
<Drup> pippijn: that's nothing like master of Orion :D
<mrvn> pippijn: no star gates, you don't drive around yourself
<pippijn> I don't actually know eve online :) I just saw a friend play it
<pippijn> I like the lightspeed part
<pippijn> mrvn: will black holes kill things that go in it?
<pippijn> will they have hawking radiation?
<Drup> pippijn: in eve, FTL travel is only used intra solar system. Inter solar system travel use some "stargate" (basically, a controlled wormhole)
<pippijn> Drup: yeah
<pippijn> mrvn: how will you know there is a black hole somewhere?
<mrvn> pippijn: by pointing a telescope at the sky and watching.
<pippijn> what will you see?
<pippijn> we can only observe black holes when we see other things spinning around them
<mrvn> the scientists will see the lensing effect on distant stars or galaxies and tell your map where to draw the bacl hole.
<mrvn> s/balc/black/
<pippijn> ah
<pippijn> okay, sounds good
<mrvn> Think of the screen as just the local neighbourhood.
<mrvn> pippijn: Looking at the drawing I'm considering a 16:9 mode. With a wide screen and controls at the left/right side of the screen instead of top/bottom.
<pippijn> that's good
<pippijn> displays are wider than tall
<mrvn> yeah. Mine too.
Drup has quit [Ping timeout: 264 seconds]
<adrien> unless you turn your head
<mrvn> or your tablet.
<mrvn> I want to support different screen sizes. Shouldn't be to hard to support different aspect ratios too and accordingly have the control elements top/bottom or left/right.
ollehar has quit [Ping timeout: 276 seconds]
dsheets has joined #ocaml
osa1 has quit [Quit: Konversation terminated!]
ollehar has joined #ocaml
<adrien> anyone has a system where the debugger isn't available?
Drup has joined #ocaml
maurer has joined #ocaml
<maurer> Is there a way to get ocamlyacc to consume the rest of the line, e.g. if you had a line-comment token that it has just consumed?
<maurer> or do I have to make a special token for that?
zpe has joined #ocaml
palomer has quit [Ping timeout: 245 seconds]
ggole has quit []
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
<gasche> maurer: you could have a token with regexp #[^'\n']*
<maurer> gasche: what does the # do?
<gasche> ah
<gasche> I assumed that was your line-comment token
<maurer> It's king of like a line comment token, what does a # do? Does that anchor it to only match the beginning of lines?
<maurer> (the problem is I'm parsing a weird format where [s at the beginning of lines mean "ignore me" but are used meaningfully in other expressions
<maurer> So if I do the naive [ .* \n style solution, maximal munch tokenizes a bunch of stuff wrong
<gasche> you could match on \n[.*\n then
<maurer> gasche: That will consume the prior line's \n then no?
<gasche> # does nothing special, I assumed it was the character signaling a comment-line
<gasche> yes it will
<maurer> unless there's a way to make a regex create two tokens?
<maurer> (because the previous line kind of needs that newline)
<maurer> (unless I reshape the rest of the parser)
<gasche> fair point
<maurer> Also, that doesn't work if there are two in a row
<gasche> next dubious idea: you could maintain a mutable bool reference that tells you what the last token was
<gasche> hm
<gasche> or rather
<gasche> you could have a specific lexing rule for beginning-of-line
<gasche> I suppose you have a rule such as
<gasche> '\n' { incr_line_num lexbuf; main lexbuf }
<gasche> where "main" is the name of your lexing rule
<gasche> you could have instead
<gasche> '\n' { incr_line_num lexbuf; beginning_of_line lexbuf }
<gasche> where "beginning_of_line" is a new rule that handles certain cases, and delegates to "main" for the rest
<gasche> hm, I'm not sure how that would work for rules that already consume the '\n'
<gasche> at some point maurer it may become easier to slice your file into a list of lines first, and then parse them separately
zpe has quit [Remote host closed the connection]
<whitequark> maurer: I don't think this is commonly done within parser
<whitequark> every language impl I've seen strips comments in the lexer.
<whitequark> stripping them in parser needlessly complicates the grammar... similarly to whitespace (well, comments are whitespace, for most purposes)
_andre has quit [Quit: leaving]
<maurer> whitequark: I'd love to do it in the lexer
<maurer> whitequark: but I can't tell whether something is at the beginning of the line in the lexer
<maurer> also, on another random note, is there a way to get a full backtrace instead of the last hundred calls or whatever?
<maurer> It's kind of annoying when I get "stack overflow" and it's just map.ml for 3 lines, then list.ml for a hundred or so, and never says where my code called it
<whitequark> maurer: why can't you?
<maurer> because the backtrace only includes map.ml and list.ml
<maurer> none of my files
<whitequark> that's a pretty natural thing to do in your lexer
<maurer> oh, that
<maurer> Dunno, but reading the ocamllex docs I can't find it
<maurer> if it's possible that would be great
<whitequark> of course it is
<maurer> and I could remove the terribad grammar rule I added
<whitequark> Lexing.new_line
<whitequark> wait, no, that's actually not what you need
<whitequark> eh. so, this is how I'd do this: make two mutually recursive scanner functions. the first one dispatches everything as usual, and dispatches \n to the second function
<whitequark> the second one does whatever you want to do specially at the beginning of line, and delegates everything else to the first function.
<maurer> So you're saying to wrap the tokenizer that gets generated by ocamllex?
<whitequark> no, ocamllex can generate such tokenizer for you
<whitequark> rule main lexbuf = ... | "\n" -> newline lexbuf and rule newline lexbuf = ...
<ollehar> anyone knows js_of_ocaml?
<ollehar> I'm trying to register a function from ocaml to js, but can't see the function name in the generated js-file
<ollehar> (Js.Unsafe.coerce Dom_html.window)##plop <- Js.wrap_callback choose_game;
<whitequark> ollehar: well, it will not appear in the generated file
<maurer> whitequark: Hm, I'll give that a shot
<whitequark> rather, when you evaluate that file, it'll appear on the global (window) object
<whitequark> maurer: might want to take a peek at ulex
<whitequark> ulex allows you to rewind the input stream a bit, that may help in this case
<whitequark> but it should be possible in ocamllex as well, it just may be wordlier.
<maurer> Yeah, I'll take a look. Any idea how to resolve issues like http://data.matthewmaurer.org/error.log other than by guessing?
wmeyer has joined #ocaml
<ollehar> whitequark: ok, but shouldn't the string "choose_game" be somewhere in the js file?
<maurer> It appears that ocaml truncates the backtrace, making it hard to tell what part of my code called the overly large map
<whitequark> ollehar: nope
<wmeyer> adrien_: ping
<whitequark> ollehar: but it may appear if you compile your code with -g, and launch js_of_ocaml with -debuginfo
<adrien> wmeyer: pong
<wmeyer> adrien: how is testing on BSD host?
<adrien> not started; I've continued re-reading and testing the changes on my machine
<adrien> found several issues which I've fixed
<wmeyer> good
<adrien> and it looks fairly solid now
<wmeyer> please continue doing that, it might be that we will release it actually
<adrien> going to proofread again tomorrow and probably test on the bsd host too
<wmeyer> Ok, as soon as you got that, let me know
<adrien> I've tried ./configure with every combination of -no-* I could do and build works each time and output is different
* wmeyer broke his main desktop 2 days ago :-)
<wmeyer> it's needed, thanks
<adrien> oh, more fun :-)
<adrien> the smallest build I get is 38MB for make world.opt
<wmeyer> yep, I am going to test your patches on Linux ARM :-
<ollehar> whitequark: so how can I then call it from javascript, e.g onclick='choose_game();' ?
<adrien> if I have time, I'll make my machine do more tests tomorrow morning; that will allow me to check every combination is properly built and installed
<whitequark> ollehar: you don't need -g/-debuginfo to call it from js, and yes, what you wrote will work
<wmeyer> adrien: OK. good, drop an email once you are done.
<Drup> ollehar: you do now you can register onclick event with js_of_ocaml ?
<adrien> not before tomorrow evening; I'll be pretty busy on tomorrow and the day after
<wmeyer> Drup: hello
<Drup> hi wmeyer :)
<wmeyer> adrien: that's fine, I was just thinking, and probably not on me, that with your momentum we might be able to make the release
<wmeyer> so feel free to attach more patches, I'll try to by SSD drive this week
<wmeyer> buy*
<adrien> you're going to make me blush ;p
<wmeyer> Drup: :)
<wmeyer> adrien: not really, it's my estimation
<ollehar> whitequark: although my test did not, hm; "choose_game is not defined". but I can see the body of the function in the js-file. (and yes, the js is loaded, confirmed with an alert).
<whitequark> ollehar: any debug messages?
<whitequark> well, s/debug/console/
<adrien> random useless data: with -no-ocamldoc -no-camlp4 -no-ocamlbuild -no-graph -no-tk -no-debugger, "make world" gives me a 14MB installation :P
<adrien> (and builds in 70 seconds on my machine; a recent desktop would take a fourth of that)
<wmeyer> I believe ocamldoc, camlp4, and ocamlbuild can be used on the host, but the cross compilers are essential
<wmeyer> camlp4 is the major offender here
<adrien> yup
<adrien> I was thinking there could then be an option to not build the compiler but use the hosts'
<adrien> so you could combine it with everything disabled but, say, ocamldoc
<adrien> that's something for later however
<Drup> ollehar: could you explain what you are trying to do ? There is stuff in js_of_ocaml to do callback
<ollehar> Drup: hi. I didn't know that, but it might not work for me. The javascript is defined in one place, but the html is generated in another.
<Drup> that's not a problem
<wmeyer> adrien: I'll welcome patches for it, later on, once we have first iteration done
<wmeyer> I think it's fairly sensible
<ollehar> Drup: I have this select item, and onchange is calling "choose_game".
<wmeyer> we could rename the compilers too, saying arm-gnueabi-linux-ocamlopt or something similar
<ollehar> I only have one big js-file at the moment, so choose_game is only defined
<ollehar> *always
Arsenik has joined #ocaml
<wmeyer> this will be excellent solution, and then we could have support from ocamlbuild with additional triple specifier to compile
avsm1 has joined #ocaml
<Drup> ollehar: If your goal is only to define an event "onchange", you can do it in ocaml
<wmeyer> I do know there exist opam with switch option, but I think here we could make it natively supported by the ocaml compiler
<adrien> wmeyer: yup, agreed: it's for later ;-)
tane has quit [Quit: Verlassend]
<adrien> wmeyer: ocamlfind works great for that
<ollehar> Drup: I guess I could look for that select on all page-loads, and if found, hook choose_game to it.
<adrien> you can chose the compiler
<adrien> typically you'd chose between ocamlopt and ocamlopt.opt but you can also but something else :-)
amirmc has joined #ocaml
<wmeyer> yes, but it has to have some native interface
<Drup> ollehar: give it an id, test if there is something with this id and you're done.
<wmeyer> avsm1: thx, for the access! helps a lot
<wmeyer> (FYI: I am not going to touch the BSD box yet, at the moment I am being very strict about my timing, but I believe adrien will make a great use of it)
palomer has joined #ocaml
<avsm1> splendid. let me know if you need any more
bkpt has joined #ocaml
<wmeyer> avsm1: OK, I will probably use it, this week, to avoid any errors on the inria CI
<Drup> wmeyer: by curiosity, why ocamlbuild doesn't issue any error (or at least, warning) when encountering an unknown flag ?
<wmeyer> Drup: good question, probably because the behavior is very dynamic, and ocamlbuild runs the code to add the tags, so generally it's not known if the tag should exist or not
<Drup> O_o
<wmeyer> but if you have some other impression, and you think it's a bug, raise mantis issue, and (possibly) provide a patch
<ollehar> Drup: I'll try that, thanks
<Drup> well, that's not an "impression". ocamlbuild never raises any warning about anything undefined in a _tags file. I got the impression it was "by design", hence my question because to me, it's very bad design.
<wmeyer> anybody from spain here? :-) I have a weird request
<wmeyer> (no, not bring me some sun, not this ...(
<Drup> (so I was curious of an insider point of view, since I never looked at ocamlbuild's sources)
* wmeyer tried idris, but cabal disapointed again (ARM Linux is still not well supported by ghci)
avsm1 has quit [Quit: Leaving.]
<wmeyer> Drup: of course, OCamlBuild is really nice, and qutie dense codebase, I don't expect that somebody understands in great detail the virtua of it :-)
<whitequark> wmeyer: what do you want arm for?
<whitequark> I'm curious
* wmeyer is impressed by chrome book, works day and nights without re-charging
<wmeyer> I just like ARM, and I work there too
<wmeyer> that's my primary laptop :-)
<whitequark> oh chromebook, I see
<wmeyer> whitequark: it's a beautiful architecture
<wmeyer> yes
<whitequark> wmeyer: no doubt it is
<wmeyer> it works quite nice actually
<wmeyer> here i have Xmonad with Emacs session and ERC chat
<wmeyer> the quality is high
<whitequark> also, I expect Broadwell to perform on par with contemporary ARM chips :)
<whitequark> I think Haswell's advanced quite a bit in the area of optimizing idle power consumption.
<wmeyer> never heard about Broadwell, but yes, even more integration with SOCs would be good
<whitequark> Haswell's successor
<wmeyer> from my perspectiv this laptop needs recharging maybe twice per week
<wmeyer> and i really use it every evening
<wmeyer> running two operating systems
<whitequark> wow, that's impressive
<adrien> I'm interested in the next stuff from amd but it's difficult a laptop that is nice as a whole
<whitequark> (that being said, I bought this i7 laptop for a reason and I have a lot of CPU-bound systems... and ARM is mainly suited for sleeping well.)
<wmeyer> adrien: I think google does very well products and cheap ones
<whitequark> *CPU-bound workloads
<wmeyer> you can try Pixel if you want spend more on highend classy device
<wmeyer> whitequark: and there is Aarch64 \o/ now
<maurer> I have an old chromebook that I like, but I basically only use it as a mobile ssh terminal
<adrien> things I like with the current low-power amd stuff: good graphics and free drivers, and I'd like to toy with HSA where they're removing barriers to communication between gpu and cpu
<whitequark> wmeyer: AA64 is mostly a server arch...
<whitequark> (arguably x86_64 was a server arch as well)
<wmeyer> whitequark: well, yes, and apart from that having more than 2G of memmory is usefuk these days
<adrien> as soon as you need 2GB of RAM for a single-process...
* wmeyer thinks Emacs with adrien patches loaded is already 2.5 G
<adrien> :D
<whitequark> pixel looks very impressive
<whitequark> will probably be my next laptop... well, its next iteration
<adrien> and expensive
<wmeyer> whitequark: indeed, i like it, it's a good alternative to highend Macs
<wmeyer> given the spec is not too bad adrien
<adrien> yeah, agreed
<wmeyer> still i prefer cheap netbook with arm :-)
<whitequark> adrien: not that expensive. it's just slightly costlier than my current ux32vd
<adrien> but I won't spend a lot of money on a laptop that I might kill at any time
<wmeyer> :D
<whitequark> besides... I'll pay a lot for good hardware :) the only reason I'm not on a Mac is because Linux power management on it sucks
<wmeyer> whitequark: if you plan to install Linux, try chrouton
<wmeyer> (Linux on chroot)
<whitequark> wmeyer: nah, the first thing I'd do is wipe it and install debian
<wmeyer> (initially I installed linux on ssd card, but then I just realised i can use chroot and get all the goodies of chrome os too)
<whitequark> I'm not exactly fond of either ChromeOS or Google services in general
<wmeyer> whitequark: your choice,
<wmeyer> i like what i have, and single keystroke is enough to go to chrome os
<adrien> night
<wmeyer> adrien: good night! happy dreams
<adrien> (going to let my laptop run my 48 ocaml builds during the night)
pzv has quit [Ping timeout: 268 seconds]
<wmeyer> adrien: thank you
<adrien> it's the computer doing all the work ;-)
<Drup> wmeyer: I have an image I use in the generated documentation. Currently I move the image manually to the directory where the documentation is build, would it be possible to add an ocamlbuild rule to move the file ?
Zeev has quit [Ping timeout: 256 seconds]
<Drup> (I'm not sure I was very clear on this)
wmeyer` has joined #ocaml
wmeyer has quit [Ping timeout: 246 seconds]
zpe has joined #ocaml
<Drup> Did I just made wmeyer flee with my questions ? :(
<wmeyer`> nope, the lights went off for few milliseconds :-)
<wmeyer`> and my router rebooted
<wmeyer`> Drup: you can ask again
<Drup> wmeyer`: I have an image I use in the generated documentation. Currently I move the image manually to the directory where the documentation is build, would it be possible to add an ocamlbuild rule to move the file ?
wmeyer` is now known as wmeyer
mathieui has quit [Ping timeout: 264 seconds]
<wmeyer> you need to add it your deps, and then it will be copied automatically
zpe has quit [Ping timeout: 245 seconds]
<ollehar> Drup: whitequark: ok, I found the error: I had written (window)##plop, so the function got bound to window.plot, like the example code on js_of_ocaml webpage ^^. should be `##choosegame` (for some reason, ##choose_game got stripped to just ##choose).
<Drup> wmeyer: I tried, it doesn't end up in the right directory :/
<Drup> ollehar: oh yeah, js_of_ocaml use a (quite too clever) convention to handle javascript's dynamic dispatch
<Drup> so it pic method name only up to the first _
<Drup> (and this way, you can bind a method with different types)
<wmeyer> Drup: it will always be in the same directory, but relative to _build not to root of the project
<wmeyer> you can always copy it in the myocamlbuild.ml
<Drup> wmeyer: yes, that's my point, I would like my images to be in the same directory as the index.html
<wmeyer> but you have to tell ocamlbuild that you have done so, probably specyfing a production
<wmeyer> even symlinking would work, beware of windows issues
<wmeyer> so in the deps you specify your source directory of the image, in prods your new destination of the image, and the rule itself will run the code to copy or symlink it
* wmeyer rebooting emacs
<Drup> to be honest, I don't really care if the only thing that doesn't work on windows is a symlink for (admittedly beautifully) pictures in the documentation. :D
Zeev has joined #ocaml
<wmeyer> lol
* adrien looks at Drup
* wmeyer :D
<adrien> I won't stop looking at you
<adrien> never
<Drup> :D
maurer has left #ocaml []
<Drup> wmeyer: I don't really know how to specify all that, I mostly work with ocamlbuild by copying stolen bit of myocamlbuild.ml from other projects. :/
<wmeyer> I can answer your questions here
<wmeyer> but let me reboot the emacs
mathieui has joined #ocaml
wmeyer has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
wmeyer has joined #ocaml
<wmeyer> re
osa1 has joined #ocaml
pzv has joined #ocaml
<Leonidas> your emacs needs quite a bit of reboots, today ;)
<wmeyer> so Drup, I'd propose to anybody who has problems with ocamlbuild just ask the questions on the caml-list, I'll answer them best to my knowledge
<Leonidas> my work is sometimes like 50% copying code from Stack Overflow, especially when it comes to LaTeX :)
<wmeyer> Leonidas: actually at least 3 time :-)
<wmeyer> maybe 4, not sure
<wmeyer> it's plesant to use Emacs on chrome book, because chromebook does not have all the keys
<wmeyer> but the ones that Emacs requires are all there
<Drup> Leonidas: I really hope that programming with ocamlbuild is less complex and error-prone that programming in latex ....
<wmeyer> Drup: there are just few rules
<wmeyer> basically it's a DSL
<Leonidas> I know few other languages that are more awful, so that is probably a pretty safe bet :)
<wmeyer> Leonidas: indeed, I'd thought that it will never happen that there exists something more powerful and obscure than Tex
<wmeyer> but there is LaTex ;)
<Drup> wmeyer: the problem is that we need a "ocamlbuild from scratch" tutorial for stupid people. The documentation is probably nice when you understand everything, but it's not at all a tutorial :/
<wmeyer> there is a wiki Drup try it
<bernardofpc> wmeyer: wait for XeLaTeX
<Leonidas> LuaLaTeX is maybe better, though Lua, well…
<Drup> wmeyer: Well, before I can even try to create a tutorial, I would like to understand what I'm doing =')
<wmeyer> there is a new typograhpy framework written in ocaml
<Drup> Leonidas: between CSS and Latex, I'm really not sure which one is the most awful
<wmeyer> i don't rememebet the name begins with P
<Drup> Patoline
<wmeyer> yes. Patoline
<wmeyer> It seems to be quite sensible
<wmeyer> I might try it, but LaTeX has a lot of packages
<wmeyer> it's like Emacs
<wmeyer> it's there, working, and in 99% working well
<Leonidas> Drup: though CSS is not turing complete. the horror that begins with L is :)
<Drup> CSS3 is turring complete ...
Zeev has quit [Ping timeout: 264 seconds]
<Leonidas> wmeyer: exactly. I thought about using ConTeXt, but then, well, fsck it, LaTeX has too many awesome packages.
<wmeyer> but Coq is not, maybe then CSS3 is stricyly more powerful. And forget to build a certified CSS3 evaulator in Coq
<Leonidas> Maybe there should be a CSS3 proof assistant. I mean, I'd love to prove the optimal coloring for my web site :)
<wmeyer> Leonidas: I quite like LaTeX but I'd not recommend it for word users
<wmeyer> actually I more used org than bare LaTeX
<pippijn> you can still build a certified evaluator in coq for turing complete languages
<pippijn> you can build a certified C++ compiler
<wmeyer> pippijn: how you can do it?
<pippijn> by limiting execution depth
gal_bolle has quit [Remote host closed the connection]
<pippijn> every C++ compiler limits template instantiation depth
<wmeyer> so that's surely termination gurantee
<pippijn> yes
<wmeyer> it allows to limit the recursion
<wmeyer> so it's not turing complete
<pippijn> right
<wmeyer> close to, but not
<pippijn> C++ templates are not turing complete in any implementation
<wmeyer> and the translator is usually not turing complete
<pippijn> you can limit the recursion to a very large number
<wmeyer> Leonidas: prove it wih poll not Coq :-)
<Drup> Leonidas: rule 110 in CSS3 : http://eli.fox-epste.in/rule110-full.html
<pippijn> like 2^128
<whitequark> Drup: that's not complete
<Drup> whitequark: strictly speaking, I agree
<wmeyer> pippijn: but then you risk your computer compiling it ages
<wmeyer> that's very brute force method of limiting computation so it will explode
<wmeyer> it places the language just below turing completness
<wmeyer> pippijn: I mean proving even facts is very difficult
<pippijn> that's true
palomer has quit [Ping timeout: 248 seconds]
<pippijn> you can prove things about evaluation steps, though
smondet has quit [Quit: Gotta go hooome]
<wmeyer> probably
<pippijn> why probably?
<pippijn> you can prove that a step of evaluation does what it should
<wmeyer> because such brute force clamp on the iteration numbers and not language semantics makes it difficult to reason in general
<wmeyer> pippijn: yes, that's true
<pippijn> it's just the final eval loop that needs the limit
<pippijn> all the way on the top
<pippijn> everything else can be certified
<Drup> wmeyer: how do I transform the cp function into an action ?
wmeyer` has joined #ocaml
Arsenik has quit [Remote host closed the connection]
<ollehar> got these errors from js_of_ocaml: missing primitives:
<ollehar> caml_ml_output_char,
<ollehar> caml_sys_exit
<Drup> this is normal
<pippijn> make stubs for them
wmeyer has quit [Ping timeout: 246 seconds]
<pippijn> that do nothing
<Drup> or do nothing, those are just warnings
<ollehar> hm, ok, thanks
Bathan has joined #ocaml
wmeyer`` has joined #ocaml
wmeyer` has quit [Ping timeout: 246 seconds]
wmeyer`` is now known as wmeyer
Bathan has quit [Ping timeout: 250 seconds]
pzv has quit [Ping timeout: 264 seconds]
pzv has joined #ocaml
Simn has quit [Quit: Leaving]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
ontologiae_ has joined #ocaml
wmeyer has quit [Ping timeout: 246 seconds]
eikke has joined #ocaml
<ollehar> problems with Firebug.console#log
<ollehar> Has no method 'log'
<mfp> ollehar: Firebug.console##log(...)
<ollehar> ah, I tried that, but without the parantheses. thanks
eikke has quit [Ping timeout: 245 seconds]
eikke has joined #ocaml
amirmc has quit [Quit: Leaving.]
<ollehar> still not working though
<ollehar> it compiles, but no logging in either firebug or firefox standard console
palomer has joined #ocaml
<ollehar> no, wait, nm
contempt has quit [Ping timeout: 245 seconds]
contempt has joined #ocaml
ontologiae_ has quit [Ping timeout: 264 seconds]
bkpt has quit [Quit: Leaving]
Neros has quit [Ping timeout: 246 seconds]
Drup has quit [Quit: Leaving.]
eikke has quit [Ping timeout: 246 seconds]
<ollehar> can I throw a javascript exception from within OCaml?
osa1 has quit [Quit: Konversation terminated!]
<ollehar> or from an Lwt thread
<ollehar> :P
<ollehar> Lwt.fail returns a thread
<ollehar> let card_select = Js.coerce_opt (document##getElementById (Js.string "card_select")) Dom_html.CoerceTo.select (fun _ -> console##error ("No card_select found"); raise LwtHack) in
<ollehar> within an lwt thread
<ollehar> silently dies
gnuvince has joined #ocaml
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
osa1 has joined #ocaml
amirmc has joined #ocaml
amirmc has quit [Ping timeout: 240 seconds]
darkf has joined #ocaml
montik has joined #ocaml
<palomer> <3 ocaml
montik has quit [Ping timeout: 248 seconds]