<NoNNaN>
whitequark: it's a wcet tool for java processor (implemented on fpga)
Yoric has quit [Ping timeout: 272 seconds]
<whitequark>
NoNNaN: I don't think there are ocaml processors?
<NoNNaN>
whitequark: I know, I am just looking for wcet analysis for ocaml
<whitequark>
do I understand it right, wcet looks at code and determines how long will it take for hardware to run if it mispredicts all branches, doesn't have any cache lines ready, ... ?
<NoNNaN>
and you asked me for non-ocaml example for such a tool
<whitequark>
I would think that you'll compile ocaml into native code and then use whatever tools you have for examining that on your target platform.
<NoNNaN>
whitequark: for hard wcet yes, for soft wcet this details ignored
<whitequark>
NoNNaN: what kind of assumptions would soft wcet use?
Yoric has joined #ocaml
<NoNNaN>
whitequark: it's us a simplified pessimistic model of the hw, for more detailed wcet every piece of the hardware has proper model eg.: http://www.jopdesign.com/publications.html
<NoNNaN>
whitequark: eg.: An SDRAM Controller for Real-Time Systems
<NoNNaN>
in theory, ocamljava output could run on jop
<NoNNaN>
probably the only missing piece would be the invokedynamic bytecode implementation (ocamljava target java7)
<whitequark>
invokedynamic can be tricky.
ollehar has quit [Ping timeout: 244 seconds]
<whitequark>
I don't know how complex could its implementation be, but that's worth a try.
<NoNNaN>
I have checked the ocapic project too, but it use a zam interpreter
ygrek has quit [Ping timeout: 265 seconds]
yminsky has joined #ocaml
yminsky has quit [Ping timeout: 265 seconds]
ollehar has joined #ocaml
BitPuffin has joined #ocaml
Yoric has quit [Ping timeout: 272 seconds]
osa1 has joined #ocaml
zpe has joined #ocaml
ggole has joined #ocaml
yminsky has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 244 seconds]
ygrek has joined #ocaml
yminsky has quit [Quit: yminsky]
aromu1117 has left #ocaml []
* whitequark
is playing with ocamljava
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
klltkr has joined #ocaml
yminsky has joined #ocaml
avsm has joined #ocaml
avsm has quit [Ping timeout: 244 seconds]
zpe has joined #ocaml
talzeus_ has quit [Read error: Connection reset by peer]
zpe has quit [Ping timeout: 248 seconds]
yminsky has quit [Quit: yminsky]
yminsky has joined #ocaml
mcclurmc has joined #ocaml
Anarchos has joined #ocaml
mcclurmc has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
yminsky has quit [Quit: yminsky]
yminsky has joined #ocaml
yminsky has quit [Ping timeout: 252 seconds]
gour_ has joined #ocaml
gour has quit [Disconnected by services]
avsm has joined #ocaml
demonimin has quit [Ping timeout: 265 seconds]
peterbb has quit [Ping timeout: 244 seconds]
yminsky has joined #ocaml
Kakadu has quit []
mcclurmc has joined #ocaml
Drup has joined #ocaml
demonimin has joined #ocaml
<bernardofpc>
is there a way to iterate over all keys of a hashtable ?
<adrien>
Hashtbl.iter?
<bernardofpc>
I'm thinking of using that as a map 'a -> 'b list through find_all
<bernardofpc>
but maybe I might just make my hashtable add more complex and have unique keys
<adrien>
you want only one call per key?
<adrien>
ok
<adrien>
I'd do that :)
<adrien>
or
<adrien>
you could do it with fold
<pippijn>
I like unique keys
<adrien>
if I understand correctly, multiple bindings for the same key will be visited one after the other
<pippijn>
yes, in insertion order
zpe has quit [Remote host closed the connection]
<adrien>
so your fold can keep track of the "previous" key and if the "current" one is the same, don't do anything
<pippijn>
eh
<adrien>
but '=' would probably be costly
<pippijn>
in reverse insertion order
zpe has joined #ocaml
<wmeyer>
adrien: I just committed your fix today, thanks.
<pippijn>
hi wmeyer
<adrien>
wmeyer: thanks and great!
<wmeyer>
hi pippijn
<bernardofpc>
the thing is that my values 'b come one by one, and I want to group them according to f('b) : 'a
<bernardofpc>
and then process each group separetedly
* adrien
needs to check if the asian traiteur is open
<adrien>
(and no, it's not a "traitor")
<bernardofpc>
using Hashtbl.add frees me from the logic "test if exists, do remove ; insert modified else add new element"
<Drup>
bernardofpc: wouldn't a regular Map solve the issue ?
<bernardofpc>
Drup: maybe
<bernardofpc>
I don't know Map very well :/
<bernardofpc>
what's the difference between Map and Hashtbl ?
<Drup>
Map is functionnal
<Drup>
the access cost are in log, not O(1)
yminsky has quit [Quit: yminsky]
<Drup>
your key ave to be comparable, in some way
zpe has quit [Ping timeout: 240 seconds]
<bernardofpc>
it's a list of ints, that should do
<Drup>
and there is no "old bindings" stuff
<pippijn>
your key is "int list"?
<bernardofpc>
yep
<pippijn>
ok
<bernardofpc>
could be an int, though
<pippijn>
small ints?
<bernardofpc>
yes
<pippijn>
a fixed number of ints?
<bernardofpc>
yes
<Drup>
why do you use a list ? :D
<pippijn>
then you can use an array
<pippijn>
as map
<bernardofpc>
sure
<adrien>
key is "int list" or keys are ints?
<ggole>
There are nice tricks for sparse sets/maps for integers, too
<bernardofpc>
key is like [1;5;8;9]
<ggole>
(If you don't need union and other such operations.)
<adrien>
if key is int list, you might get a baaaad performance with hashtbl
<adrien>
maybe not deep enough
<adrien>
and maybe not with new versions of ocaml
<Drup>
bernardofpc: if you have fixed number of int, use a tuple
<Drup>
or better, a record
tobiasBora has quit [Ping timeout: 252 seconds]
<bernardofpc>
right
<adrien>
or if they're small, a + 100*b + 10000*c + 1000000*d :D
<Drup>
adrien : indeed :p
<bernardofpc>
:D
Qrntz has quit [Changing host]
Qrntz has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
<Drup>
bernardofpc: and if you are going to use Map, take care of using a specialize comparison function
<bernardofpc>
right :D
<bernardofpc>
also
<bernardofpc>
Let me state my problem again: from something like a "'b list" and f : 'b -> 'a, I'd like to retrieve a "'b list list" where on each list all elements have the same f
<bernardofpc>
like "calculate the sets f^(-1){a} for a in f(B)"
<bernardofpc>
I could sort the 'b list, then "split", but that seems a bit strange
<Anarchos>
bernardofpc use List.partition
<Anarchos>
(or List.filter)
mcclurmc has joined #ocaml
<bernardofpc>
Anarchos: the problem is that the ratio "bs that have the same f(b)" is small, so at the end I'd go through many calls of partition ?
<Anarchos>
bernardofpc i can't help you further, i am not an ocaml algorithm expert :)
<bernardofpc>
no pb, thanks I didn't know partition
mcclurmc has quit [Ping timeout: 264 seconds]
mcclurmc has joined #ocaml
avsm has quit [Quit: Leaving.]
rwmjones has quit [Ping timeout: 244 seconds]
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rwmjones has joined #ocaml
tobiasBora has joined #ocaml
nikki93 has joined #ocaml
osa1 has quit [Remote host closed the connection]
osa1_ has joined #ocaml
robink has quit [Quit: No Ping reply in 180 seconds.]
robink has joined #ocaml
robink has quit [Changing host]
robink has joined #ocaml
ia0 has quit [Ping timeout: 240 seconds]
ia0 has joined #ocaml
ollehar has quit [Ping timeout: 244 seconds]
avsm has joined #ocaml
lamawithonel_ has quit [Remote host closed the connection]
avsm1 has joined #ocaml
tobiasBora has quit [Quit: Konversation terminated!]
avsm has quit [Read error: Connection reset by peer]
nikki93 has quit [Ping timeout: 272 seconds]
demonimin has quit [Ping timeout: 252 seconds]
ollehar has joined #ocaml
lamawithonel_ has joined #ocaml
peterbb has joined #ocaml
avsm1 has quit [Quit: Leaving.]
yminsky has joined #ocaml
yminsky has quit [Client Quit]
yminsky has joined #ocaml
yminsky has quit [Quit: yminsky]
mcclurmc has quit [Remote host closed the connection]
zpe has joined #ocaml
mcclurmc has joined #ocaml
demonimin has joined #ocaml
zpe has quit [Remote host closed the connection]
mcclurmc has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 265 seconds]
ygrek has quit [Ping timeout: 245 seconds]
peterbb has quit [Ping timeout: 272 seconds]
testcocoon has quit [Quit: Coyote finally caught me]
cesar_ has joined #ocaml
cesar_ is now known as Guest77766
testcocoon has joined #ocaml
mcclurmc has joined #ocaml
Guest77766 has quit [Remote host closed the connection]
Guest17848 has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
nikki93 has quit [Ping timeout: 264 seconds]
mcclurmc has quit [Ping timeout: 245 seconds]
peterbb has joined #ocaml
contempt has quit [Ping timeout: 264 seconds]
contempt has joined #ocaml
peterbb has quit [Ping timeout: 252 seconds]
contempt has quit [Ping timeout: 252 seconds]
contempt has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest42698
baz_ has joined #ocaml
contempt has quit [Ping timeout: 272 seconds]
contempt has joined #ocaml
nikki93 has joined #ocaml
Yoric has joined #ocaml
contempt has quit [Ping timeout: 240 seconds]
contempt has joined #ocaml
ggole has quit []
Xenasis has joined #ocaml
contempt has quit [Ping timeout: 265 seconds]
zorun has joined #ocaml
Yoric has quit [Ping timeout: 245 seconds]
rand000 has joined #ocaml
contempt has joined #ocaml
baz_ has quit [Remote host closed the connection]
Yoric has joined #ocaml
mort___ has joined #ocaml
contempt has quit [Ping timeout: 252 seconds]
contempt has joined #ocaml
nikki93 has quit [Remote host closed the connection]
contempt has quit [Ping timeout: 245 seconds]
contempt has joined #ocaml
contempt has quit [Ping timeout: 272 seconds]
contempt has joined #ocaml
Yoric has quit [Ping timeout: 245 seconds]
Xenasis has quit [Remote host closed the connection]
thomasga has quit [Quit: Leaving.]
contempt has quit [Ping timeout: 248 seconds]
zorun has quit [Quit: leaving]
contempt has joined #ocaml
mort___ has quit [Ping timeout: 244 seconds]
mort___ has joined #ocaml
thomasga has joined #ocaml
mcclurmc has joined #ocaml
peterbb has joined #ocaml
BitPuffin has quit [Read error: Operation timed out]
jonludlam has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
BitPuffin has joined #ocaml
nikki93 has joined #ocaml
jonludlam has quit [Ping timeout: 245 seconds]
Xenasis has joined #ocaml
thomasga has quit [Quit: Leaving.]
gour_ is now known as gour
mcclurmc has quit [Remote host closed the connection]
jonludlam has joined #ocaml
yminsky has joined #ocaml
Yoric has joined #ocaml
yminsky has quit [Client Quit]
yminsky has joined #ocaml
peterbb has quit [Ping timeout: 240 seconds]
platypine has joined #ocaml
klltkr is now known as klltkr[HOU]
wormphlegm has quit [Quit: leaving]
wormphlegm has joined #ocaml
yminsky has quit [Quit: yminsky]
yminsky has joined #ocaml
yminsky has quit [Client Quit]
Yoric has quit [Ping timeout: 248 seconds]
darkf has joined #ocaml
zarul has quit [Ping timeout: 252 seconds]
mort___ has quit [Ping timeout: 245 seconds]
mort___ has joined #ocaml
ulfdoz has quit [Ping timeout: 264 seconds]
gour has quit [Quit: WeeChat 0.4.1]
ocp has joined #ocaml
ocp has quit [Client Quit]
wolfnn has quit [Read error: Operation timed out]
davidDenver has joined #ocaml
<davidDenver>
it seems that all of the documentation that I have found so far is very poorly written for beginners. is there a pdf I can read on syntax? also, as an example what is 'elt' here? # let rec sort lst =
<davidDenver>
# match lst with
<davidDenver>
# [] -> []
<davidDenver>
# | head :: tail -> insert head (sort tail)
<davidDenver>
# and insert elt lst =.... I also don't see any 'insert' function documentation.
<davidDenver>
is '1st' just an argument?
<Drup>
let ... and .... is the mutually recrusive declaration
<Drup>
so, insert is a new function, in your code.
<davidDenver>
oic
<davidDenver>
so let is let
<davidDenver>
and elt is recursive?
<pippijn>
it should be let rec
<davidDenver>
recursive let?
<pippijn>
let rec is recursive
<pippijn>
let ... and is not (mutually) recursive
<davidDenver>
no no no, if you go to the ocaml manual
<davidDenver>
the code is like above.
<davidDenver>
so the question is what is "elt"
<pippijn>
yes, and you see "let rec"
<davidDenver>
it's all over the place
<pippijn>
elt is just a name
<pippijn>
elt means element
<pippijn>
insert element list
<davidDenver>
aha
<pippijn>
shortened to insert elt lst
<davidDenver>
ok great
<davidDenver>
where would I find abbreviations like that? a pdf? url?
<pippijn>
good question :)
<davidDenver>
I've been coding for 40 years, so I'm not a rank beginner, just new to ocaml
peterbb has joined #ocaml
<Drup>
it's just naming practice, I don't know if it's defined somewhere :p
<davidDenver>
there seem to be a lot of assumption with respect to syntax
<davidDenver>
like:
<davidDenver>
# match lst with
<davidDenver>
# [] -> []
<davidDenver>
what is with the brackets?
<davidDenver>
I understand it's a match
<davidDenver>
so is it substantially global = global? in that it matches anything?
yminsky has quit [Remote host closed the connection]
yminsky has joined #ocaml
<davidDenver>
what does the bracket assignment mean? [] -> []
<Drup>
hum, the explanations of pattern matching is not extremely good, but not terrible either.
<davidDenver>
I understand regex pattern matching
<davidDenver>
but empty brackets don't mean anything to me
<Drup>
davidDenver: It's not an assignment, it means "if the list "lst" looks like an empty list [], then give an empty list []
<davidDenver>
well there you go, that makes sense.
<davidDenver>
so it's returning an empty list when it sees an empty list
<Drup>
davidDenver: to be honest, the manual is a good manual but not a very good tutorial
<Drup>
you can find better ones on the net
<davidDenver>
so you could match [] -> [1;2;3]
<davidDenver>
so if the list '1st' matched empty you could return a list of 1,2,3.
<Drup>
especially if you are not familiar with the functional paradigm.
<Drup>
(yes, that works)
<davidDenver>
all they have to do is explain the basics and anyone with an IQ over 145 can figure it out, and since most programmers are way over that, which is why we are programmers, they really should just explain the basic syntax right up front.
<davidDenver>
I bought an Ocaml book
<davidDenver>
Practical Ocaml
<davidDenver>
a little old, but I like older books
<davidDenver>
the code is going to be more tested.
<davidDenver>
that connects to a postgres database
<davidDenver>
I have found the postgres driver
<davidDenver>
and ocamlnet
<davidDenver>
I have ocaml 3.11.2-2 from debian squeeze
<Drup>
davidDenver: not to be presumptuous or something, but if you are on the step of understanding pattern matching, you still have a bit of work ;)
<davidDenver>
the question is that I need a resource for setting up the cgi so that there is one basic page that has form data, and then insert into the postgres table.
<davidDenver>
I understand regex, and I'll figure it out pretty quick
<davidDenver>
once I have the basic idea down. like I've said, I've coded for 40 years, so all I have to do is get a grip on the syntax.
<davidDenver>
is there a HOWTO on cgi setup with ocamlnet?
<Drup>
it has nothing do to with regex
<davidDenver>
yeah, I realize that
<Drup>
davidDenver: with what language did you worked ?
<davidDenver>
everything from assembler on up. c++, cobol, fortran, modern stuff like php, I've learned over the years probably a dozen languages. nothing functional though.
<davidDenver>
I've looked at haskell
<davidDenver>
but settled on ocaml
<Drup>
ok
<davidDenver>
frankly, the reason is the benchmarking
<davidDenver>
compiled ocaml over the net
<Drup>
you will see that a good chunk of you programming experiences will not help you
<davidDenver>
is as fast as assembler
<davidDenver>
yes, I'm seeing that
<davidDenver>
it's a different way of thinking
<Drup>
so, don't rush it, take your time :)
<davidDenver>
if I have a working web example, I can expand from there
<Drup>
it's not really difficult, if you accept ot "forget" (not completly, of course !) what you are used to
<davidDenver>
frankly what I would do is write my procs and triggers in the database and simply use the ocaml for the cgi
<Drup>
I don't use ocamlnet, so I don't have any exemples for you, sorry.
<davidDenver>
there is no SMP in ocaml? compiled code?
<davidDenver>
I see there are threads though
<davidDenver>
would you say I need to put my emphasis right now on pattern matching?
<Drup>
well, it's a very used feature, but it goes with a lot of other stuff :)
<davidDenver>
I'll go look at that Oreilly book.
<davidDenver>
thanks for the time
<Drup>
no problem.
<davidDenver>
I just went to the link, is there a pdf of it?
Guest42698 has quit [Remote host closed the connection]
<Drup>
there is an online version for the beta, there should be a pdf as soon as it's out.