talzeus has quit [Remote host closed the connection]
introom has joined #ocaml
<bernardofpc>
why does utop greet me with """ ─( 21:00:00 )─< command 0 > """ ?
<bernardofpc>
(the 21:00:00 is there independent of the actual time i lounched utop)
<bernardofpc>
(might be relevant that I'm in -0300 Time Zone, so if that's a "0" that gets converted from a timestamp to localtime, then that's just an uninitialized variable)
<bernardofpc>
(after, the clock catches up)
walter has quit [Read error: Connection reset by peer]
walter has joined #ocaml
weie_ has quit [Ping timeout: 268 seconds]
weie has joined #ocaml
gautamc has quit [Read error: Connection reset by peer]
ollehar has joined #ocaml
gautamc has joined #ocaml
<MarcWeber>
I've found a nice way to get a stack trace on linux without stopping my application: flush_all(); let r = Unix.fork() in if r == 0 then raise Exit :)
pootler__ has quit [Ping timeout: 248 seconds]
pootler_ has quit [Ping timeout: 264 seconds]
<Drup>
MarcWeber: look at the Printexc module in the standard library
<MarcWeber>
Drup: I know about that, and that only records traces for exceptions ?
<MarcWeber>
flush_all(); let pid = Unix.fork() in
<MarcWeber>
let _ = if pid == 0 then raise Exit else Unix.waitpid [] pid in ();
<MarcWeber>
My final version ..
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
ygrek has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
mehdid has quit [Ping timeout: 248 seconds]
dsheets has joined #ocaml
mehdid has joined #ocaml
Neros has quit [Ping timeout: 264 seconds]
osnr has quit [Quit: Leaving.]
darkf has joined #ocaml
dsheets has quit [Ping timeout: 246 seconds]
cdidd has joined #ocaml
introom has quit [Remote host closed the connection]
talzeus has joined #ocaml
Watcher7|off is now known as Watcher7
rks is now known as Guest69954
ontologiae_ has joined #ocaml
ontologiae_ has quit [Ping timeout: 255 seconds]
emmanuelux has quit [Quit: emmanuelux]
introom has joined #ocaml
Drup has quit [Quit: Leaving.]
gautamc has quit [Ping timeout: 246 seconds]
ggole has joined #ocaml
gautamc has joined #ocaml
gautamc has quit [Client Quit]
gautamc has joined #ocaml
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
pootler__ has joined #ocaml
pootler_ has joined #ocaml
justdit has joined #ocaml
justdit has quit [Ping timeout: 256 seconds]
osnr has quit [Quit: Leaving.]
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
osnr has quit [Quit: Leaving.]
pootler__ has quit [Ping timeout: 276 seconds]
pootler_ has quit [Ping timeout: 276 seconds]
derek_c has joined #ocaml
tane has joined #ocaml
csakatoku has joined #ocaml
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
yacks has quit [Read error: Connection reset by peer]
osnr has quit [Quit: Leaving.]
Tekk_ has joined #ocaml
<Tekk_>
are there any resources as far as actually using modules from opam? The site documents how to install opam itself pretty nicely, but I can't seem to actually get them to work. I did the .profile stuff, but opening up ocaml and typing, for example, #use "Sdl";; results in it complaining that sdl isn't found
<Tekk_>
the variables are set though, which is what's annoying
weie has quit [Read error: Connection reset by peer]
weie has joined #ocaml
ben_zen has joined #ocaml
ulfdoz has joined #ocaml
foo808_ has quit [Read error: Connection reset by peer]
ocaml_newbie has joined #ocaml
<orbitz>
Tekk_: most things have an ocamlfind interface, s oyou can just use ocamlfind to use it
<orbitz>
Tekk_: so #use "topfind"; #require "Sdl";; I think
<orbitz>
#list;; to show aeverything available
<Tekk_>
hmm
<Tekk_>
"Cannot find file topfind."
<Tekk_>
I'm actually starting to think that ocaml didn't install right :/
<orbitz>
what do you mean when you say you did the profile stuff?
<orbitz>
did you actually load the opam environment?
<Tekk_>
orbitz: opam comes with some shell scripts to do stuff like setting env vars
<Tekk_>
I have them running
<orbitz>
"have them running"?
<Tekk_>
sorry, nearly 4 am here. I have the variables set :P
<orbitz>
so you succesfuly dod opam install sdl?
<Tekk_>
yeah, opam can successfully install things
<orbitz>
did*
<Tekk_>
it just seems that ocaml doesn't want to actually load modules
<orbitz>
Well, you are using #use wrong
<orbitz>
so the error you get is correct
ben_zen has quit [Ping timeout: 276 seconds]
<Tekk_>
orbitz: what'd be a valid #use then?
<Tekk_>
I've been doing #use "module";;
<Tekk_>
b
<orbitz>
do you have a module in your math that maches taht name?
<Tekk_>
I should
<orbitz>
does 'opam list --installed ocamlfind' give you anything?
<orbitz>
Tekk_: Why should you?
<orbitz>
#use doesn't do what you think it does
<Tekk_>
orbitz: because OCAML_LD_LIBRARY_PATH contains a directory with the .so file
<Tekk_>
orbitz: yeah, it says that ocamlfind is installed
<orbitz>
and #use "topfind";; doesn't work for you?
<Tekk_>
nope
<Tekk_>
wait..
<orbitz>
Tekk_: then your setup is not what you think it is. also I don't think #use searches OCAML_LD_LIBRARY_PATH
<Tekk_>
so I can get #use "toplevel";; to work if I manually source the variables
<Tekk_>
but not if they're in my .tcshrc
<Tekk_>
that's...interesting
q66 has joined #ocaml
chrisdotcode has quit [Ping timeout: 255 seconds]
<ggole>
I don't think #use "topfind" is supposed to work in a plain toplevel
<ggole>
It certainly doesn't for me
<ocaml_newbie>
Hello, what tis error message means "Camlp4: Uncaught exception: DynLoader.Error ("/root/.opam/system/lib/pgocaml/pa_pgsql.cma", "error while linking /root/.opam/system/lib/pgocaml/pa_pgsql.cma.\nReference to undefined global `Batteries'")", i have installed pgsql and batteries.
chrisdotcode has joined #ocaml
Tekk_ has left #ocaml []
<ggole>
Does other batteries stuff work?
<ocaml_newbie>
I don't know, I installed batteries and pgocaml with opam the ocsigen package manager. I tried to compile an ocsigen project with pgocaml. How can I check if other batteries stuff work?
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
<ggole>
Just refer to something in that module
<ggole>
If ocaml doesn't know what it is, you need to point it to batteries (using ocamlfind or whatever)
derek_c has quit [Ping timeout: 268 seconds]
talzeus has quit [Remote host closed the connection]
derek_c has joined #ocaml
csakatoku has quit [Remote host closed the connection]
chrisdotcode has quit [Ping timeout: 240 seconds]
ygrek has joined #ocaml
osnr has quit [Ping timeout: 276 seconds]
<ocaml_newbie>
making a dile with batteries, and compiling it works. ocamlfind find the library
ygrek has quit [Ping timeout: 246 seconds]
jpdeplaix has quit [Read error: Operation timed out]
<ggole>
So the other code must be doing something differently
<ggole>
How is it built?
<orbitz>
ggole: what do you mean by plain toplevel?
<ggole>
orbitz: if you install all the latest junk and type ocaml at a bash prompt, #use "topfind" will not function.
<ggole>
You have to add some stuff somewhere (.ocamlinit?)
<orbitz>
hrm, i believeit works for me...
<orbitz>
as long as ocamlfind is installed
<ocaml_newbie>
eliomc -c -package batteries,pgocaml.syntax source.eliom , should work the same as ocamlc
<ggole>
let () = try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH") with Not_found -> () in .ocamlinit seems to be the magic incantation
<ggole>
Sigh, I hate having to type magic shit into random files
<orbitz>
i don't have that in mine
<ggole>
Then something is different somewhere
<orbitz>
opam does set taht for me though
<orbitz>
i mean the env variable
<ggole>
Yes, I get that
<ggole>
But not the Topdirs stuff
<ggole>
ocaml_newbie: hmm, I have no knowledge of eliomc
<orbitz>
only stuff in my .ocamlinit is doing #use "topfind";; and loading up core
<ggole>
Perhaps it has changed?
<ggole>
I installed rather recently though
<ocaml_newbie>
ggole: It woks the same way as ocamlc, it is just to compile eliom files, you can compile with eliomc normal .ml files
<ggole>
ocamlc does not take a -package parameter
<ggole>
So there appears to be some machinery there
<ggole>
Which I know nothing of
<ggole>
I would proceed by making a test file that just mentions a batteries reference, and then seeing what is necessary to get eliomc to compile it
<ggole>
(Unless that's what you did before: I get the impression you did that test with ocamlc)
ygrek has joined #ocaml
<ocaml_newbie>
it compiles with eliomc, eliomc seems like ocamlfind ocamlc, probably with some linking to eliom libraries
<ggole>
Hmm
<ggole>
But it doesn't find it for the other code?
jpdeplaix has joined #ocaml
<ggole>
That seems a bit odd.
<ggole>
I'm not really sure where to go from there: maybe there is some special situation with dynamic linking (which I've never played with).
<ocaml_newbie>
It's kind of weird
montik has quit [Remote host closed the connection]
Watcher7 is now known as Watcher7|off
derek_c has quit [Quit: Lost terminal]
<orbitz>
can i do 'include Foo with type t = blah in the toplevel of a module?
ygrek has quit [Ping timeout: 264 seconds]
ocaml_newbie_sav has joined #ocaml
ocaml_newbie has quit [Ping timeout: 264 seconds]
Neros has joined #ocaml
emmanuelux has joined #ocaml
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
emmanuelux has quit [Quit: emmanuelux]
yacks has joined #ocaml
yacks has quit [Ping timeout: 256 seconds]
Snark has joined #ocaml
malo has joined #ocaml
justdit has joined #ocaml
mcclurmc has quit [Ping timeout: 276 seconds]
ulfdoz has quit [Read error: Operation timed out]
justdit_ has joined #ocaml
justdit has quit [Read error: Connection reset by peer]
ocaml_newbie_sav has quit [Ping timeout: 256 seconds]
justdit has joined #ocaml
justdit_ has quit [Ping timeout: 255 seconds]
ulfdoz has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
justdit has quit [Ping timeout: 256 seconds]
justdit has joined #ocaml
testcocoon has joined #ocaml
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
ygrek has joined #ocaml
osnr has quit [Ping timeout: 255 seconds]
osa1 has joined #ocaml
f[x] has joined #ocaml
ygrek has quit [Ping timeout: 255 seconds]
ontologiae_ has joined #ocaml
<whitequark>
hm... suppose I have some kind of values, e.g. integers, which may as well be represented by ocaml integers
<whitequark>
then, I have a compiler IR, SSA-based, which has such operations as "load constant into register", "sum integers", "subtract integers", and each operation has a corresponding source location
<whitequark>
then, constants in SSA are stored in wrappers: each wrapper holds a wrapped value together with a list of "relevant" source locations
<whitequark>
then, each arithmetic operation unwraps the value, performs the arithmetics, and wraps it while appending its own source location to the list inside a wrapper
<whitequark>
did I just invent a monad? :]
eni has joined #ocaml
<pippijn>
happy birthday alan turing
eni has quit [Ping timeout: 248 seconds]
<jdoles>
Who are the modern day Alan Turings?
<jdoles>
Perhaps they are also working for the GCHQ.
<tane>
military scientists
<tane>
right :)
<jdoles>
tane: those people never publish anything in normal places?
<tane>
usually not
<jdoles>
tane: sure, but I'd expected at least some of it to be publically known.
<jdoles>
I am not even sure whether we have military scientists.
<tane>
:)
<tane>
who is "we"?
<jdoles>
Not important.
<jdoles>
The US surely has them, no doubt.
mcclurmc has joined #ocaml
<jdoles>
I know some people who work for government labs, but they are not off the scale intelligent.
<tane>
you could a hint, but doesn
<jdoles>
I know there are some people who are off the scale, but sofar I think I could only count to 1 or so confidently.
<jdoles>
There should be at least 500 or so Einstein equivalents globally now.
<jdoles>
tane: you are saying that there is someone like Tesla living today, but he is just be used for government research only?
<jdoles>
being
<tane>
what i say, that the comparison is faulty
<tane>
what is someone "like Tesla"
<tane>
how could you identify him, what should he have to do?
talzeus has joined #ocaml
<tane>
there are dozens of capable people, still, you cannot as easily isolate them as in prior times
<jdoles>
tane: I suppose invent new physical principles every few years would count.
<tane>
have a look at a tree
<tane>
i think its a good metaphor
<tane>
if you are near the root, you can easily overview all leafs
<tane>
if you are near a leaf, it maybe hard to see all other leafs, where seeing implies a route via edges
<tane>
this is what we have today
<tane>
not so easy to be a general scientist anymore
<tane>
if you read biographies you'll notice, that in the last centuries there were a lot of scientists, who switched from one field to another easily, and had a great general knowledge
<tane>
if you have this today, that's fine, but not really useful to discover the microscopic things which are researched today
<jdoles>
tane: you mean that everything has been so specialized that 1) it's hard for a layman to understand the value of the contribution 2) it's harder to enter a new field?
<tane>
yes, that's what i believe or guess, is a part of problem in easily identifying single geniuses
<whitequark>
jdoles: what about Shinichi Mochizuki?
<orbitz>
Is there a sufficiently mature version of quickcheck for ocaml?
<whitequark>
or Andre Geim?
<orbitz>
I really don't want to generate all these key comparisons by hand :)
gautamc has quit [Read error: Connection reset by peer]
<jdoles>
whitequark: if he is right with this proof, he would qualify, but I consider it rather stupid that he didn't contact someone to make it work in something like Coq.
introom has quit [Remote host closed the connection]
Guest69954 is now known as rks`
<whitequark>
jdoles: I see a strong parallel with 'geniuses' of the past here :)
<whitequark>
but generally, you are right
<jdoles>
whitequark: I am not qualified to say much about Andre Geim, but it appears to be more of a highly intelligent and succesful individual, not so much pure genius.
<whitequark>
jdoles: I'm at loss when it comes to strict definition of a genius
<jdoles>
orbitz: you can also just use Haskell and read the cases back in in Ocaml.
<whitequark>
so, have nothing to reply.
<orbitz>
jdoles: That adds quite the dependency to my tests
<jdoles>
Pure genius is what you need to think of an idea and execute it 20+ years before the rest does it.
ocaml_newbie has joined #ocaml
<orbitz>
unfortunately doing things 20+ years before the rest of teh world realizes they want it doesn't seem to get you very far in this world ;(
<jdoles>
Yeah, 20 years is a long time today too.
<whitequark>
jdoles: that seems rather arbitrary to me.
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
<orbitz>
if you use /r/proggit has an indicator, only just now are people starting to see the value in the image-based devleopment that Smalltalk had decades ago
<jdoles>
I also think my definition makes it impossible for any new geniuses to qualify.
<jdoles>
Save from secret government computer intelligence.
<jdoles>
I wonder how far along they are already with building SkyNet.
justdit_ has joined #ocaml
<jdoles>
Clearly they believe there is an arms race in super computing; they probably know how to use that sea of computation for something, besides spying.
<orbitz>
I think it'sfunny that when it comes to doing things opening nobody thinks the (US) government is capable, but when it comes to doing things covertly they think they are capable of anything. Your comment just amde me think of that.
<jdoles>
orbitz: they aren't the same people.
<orbitz>
jdoles: they might, the question is: does anyone above care about using it for things other than spying?
<jdoles>
orbitz: NSA like organizations are like independently managed islands.
<jdoles>
orbitz: they are independent of politics and are more like the military, I'd think.
<jdoles>
Some parts of the US army/navy are very well managed, IMHO.
<orbitz>
In it's public ventures the military hasn't been particualrly successful at doing much other than spending money
<orbitz>
IMO
<jdoles>
Take a look at how they organized D-Day for example.
justdit has quit [Read error: Connection reset by peer]
<orbitz>
I think 1950s US government is likely not particuallry comparable to today
<jdoles>
orbitz: sure, but that has other reasons.
<jdoles>
orbitz: you are probably right about that, but are you saying they are less capable now?
osnr has quit [Ping timeout: 268 seconds]
<jdoles>
I.e., worse leadership, etc.
<jdoles>
Not technological ability.
<whitequark>
orbitz: I don't think that image-based development is somehow fundamental
<whitequark>
fads come and go in cycles.
<whitequark>
even useful ones.
<jdoles>
whitequark: image-based development is not a fad.
<jdoles>
whitequark: it's a very sound idea if you want systems that work fast.
<whitequark>
jdoles: ok, let me rephrase
<whitequark>
it is one of several approaches to engineering which may be very useful for a) certain tasks b) for certain social groups.
<jdoles>
If I look at my current file system, I often think transactional semantics would make programs more robust.
<whitequark>
this, in my opinion, does not qualify as a fundamental development
<whitequark>
jdoles: NTFS has had transactional semantics
<jdoles>
whitequark: had?
<whitequark>
yes, they removed it in win7
<jdoles>
Why did they remove it?
<whitequark>
I don't know if it was implementation or the idea itself, but it was kind of overcomplicated and didn't really work well
<whitequark>
on one hand, it's Microsoft. on the other hand, their kernel is rather well done.
<whitequark>
so, cannot say much.
<jdoles>
It would be interesting what the real reason is.
<whitequark>
let me try to find an article
<jdoles>
[to know]
<orbitz>
jdoles: i think organizationally they are, yes. At leastin terms of what leaks out to the public.
yacks has joined #ocaml
<orbitz>
POSIX gives you some nice atomic FS operations at least
<orbitz>
jdoles: and by 'they are' i mean 'less capable'
<jdoles>
Private industry should never have been given such a large role.
<whitequark>
orbitz: that's baseline. I'm not sure how one can even try to build a robust system without atomic FS operations.
<jdoles>
Blackwater (they are named differently now) is a very questionable organization.
<orbitz>
whitequark: I don't know enough about windows file systems semantics to comment.
<jdoles>
Imagine that private armies are larger than the public ones at some point.
<orbitz>
Hah, Blackwater's new naem is 'Academi'
<jdoles>
orbitz: yeah, I know.
<orbitz>
Definitly some rebranding going onthere
<jdoles>
orbitz: definitely.
<jdoles>
orbitz: "we do training"/"we shoot children"
<jdoles>
orbitz: same company, different image.
gautamc has joined #ocaml
<orbitz>
I don't know enough about the subject to have an opinion
<orbitz>
It's a shame though, Blackwater is a pretty badass name for a company :(
<jdoles>
orbitz: sounds like it came just from Halflife.
<orbitz>
yeah
<orbitz>
Can I 'include' a module at a top level of a module?
<bernardofpc>
because they allow us to name a complicated thing in a fast way
<jdoles>
bernardofpc: for short-term gain.
<bernardofpc>
once we're used to it, it helps a lot
<pippijn>
xs is kind of common
<bernardofpc>
jdoles: I'd argue the converse
<pippijn>
for list of x
<jdoles>
xs and xss are common, indeed.
<orbitz>
i usually do *s
<bernardofpc>
hd::tl also
<jdoles>
But there is a reason why you don't do that for domain objects.
<orbitz>
what's the defintion of 'domain object'?
<bernardofpc>
jdoles: my best argument is math-based
<bernardofpc>
you don't unwind the definition of a "Kähler Manifold" every time you work with one
<jdoles>
bernardofpc: that's abstraction.
Drup has joined #ocaml
<jdoles>
If you want to learn software development, visit a university, if you haven't already.
<bernardofpc>
jdoles: variable names (or *value* names in OCaml) are also
<bernardofpc>
they abstract its representation to its meaning
<orbitz>
Hrm, based on coworkers, I can't say many uni's teach software dev partiucrlly well
<pippijn>
I agree, p1ss is badly named
ulfdoz has quit [Ping timeout: 268 seconds]
<orbitz>
or amazingly named!
<pippijn>
I'll improve it later
<bernardofpc>
back to loops
<pippijn>
because right now, it doesn't even work yet
<whitequark>
jdoles: if you want to learn software development, do software development
<ggole>
Do universities really teach software development?
<jdoles>
orbitz: perhaps it's hit and miss then.
<orbitz>
doing it doesn't seem to teach it particuarlly well either
<ggole>
I was under the impression that they mainly teach algorithms
<bernardofpc>
I have written something like "while (fun_complicated n) != 0 do let x = fun_complicated n in ... done ;;
<orbitz>
bernardofpc: sounds terrible
<jdoles>
ggole: you implement things too and they get graded for design too.
<bernardofpc>
yeah
<bernardofpc>
but my induction variable is n
<bernardofpc>
and the condition is on f(n)
<jdoles>
ggole: also, it's not about teaching algorithms.
<orbitz>
I'm solving the problem of translating 1 sequence of values to a new sequence of values where 2 values become 1 value, which is easy, it's jus tannoying when your source can odd number of values
<ggole>
Implementing a linked list doesn't necessarily teach you how to organise software well
<ggole>
And organisation is infinitely more important than algorithms
<whitequark>
programming in the large vs programming in the small
<jdoles>
ggole: a good program covers all those things.
<whitequark>
both are important.
<orbitz>
I have not met any, undergarudate student at least, that has learned howt to develop software at some level of scale
<pippijn>
bernardofpc: that sounds like it's either an infinite loop or mutating code
<bernardofpc>
jdoles: which uni are you (in/from) ?
<ggole>
(Not because algorithms don't matter, but because they are easy to fix if they are wrong/slow.)
<ggole>
jdoles: well, that's good
<bernardofpc>
pippijn: yeah, filling in a prime sieve
<whitequark>
ggole: disagree
<bernardofpc>
(sorta)
<pippijn>
ah
<jdoles>
Universities are accredited these days.
<whitequark>
ggole: I've seen more than once whole frameworks built upon inherently flawed assumptions.
<jdoles>
There are standard programs.
<bernardofpc>
jdoles: US ?
<jdoles>
If you find a university with well known people, you will be fine.
<jdoles>
bernardofpc: EU
<Drup>
ggole: I have seen so many terrible things done by people that never take the time to learn basic things in computer science that I have to disagree
<bernardofpc>
jdoles: not in FR, i hope ?
<ggole>
whitequark: and they are hard to fix because of organisational issues
<whitequark>
ggole: so, you cannot fix it: it's already baked deep into your code and in others code
<ggole>
Yes, that's what I mean
<jdoles>
bernardofpc: how do you mean, I hope?
<whitequark>
ggole: no, not what I mean.
<ggole>
It's crucial to not have that
<jdoles>
bernardofpc: you wouldn't want to be in the same country as me?
<ggole>
Because any mistake will kill you.
<bernardofpc>
jdoles: I'm on the other side of both lines
<bernardofpc>
(Rio, BR)
<ggole>
Whereas an algorithmic blunder is usually just a fix (and maybe some head scratching)
<jdoles>
I was in ##friendly-coders.
<ggole>
Drup: yes, I've seen some horrors
<bernardofpc>
the thing is that my french friends who are good programmers never learnt from their unis
<jdoles>
There was a guy who asked how to solve some problem more efficiently.
<jdoles>
The solution he had was absolutely terrible.
<jdoles>
That's the kind of reason why you apparently need to have some kind of formal training.
<bernardofpc>
(they learnt amazing things in unis, but that did not made them good programmers, they were already)
<jdoles>
Universitiy learns *something* that people with lower education don't learn and it's hard to put your finger on what exactly.
<ggole>
You don't need formal training to be able to spot problems like that.
<bernardofpc>
whitequark: not sure
<ggole>
(Although I'm sure it helps you on the way.)
<bernardofpc>
some methods of solving some problems
<whitequark>
I've seen university programs here in RU. It's interesting.
<jdoles>
whitequark: I think it's mostly mind-set.
<Drup>
ggole: no, sometimes it's beyond "horrors", when people that never takes any compiler class try to do a compiler, the organization is terrible because they have absolutely no idea what they're doing. And that's obviously those languages that become hype and famous.
<whitequark>
they do teach algorithms, also they do teach non-algorithmic stuff... programming in C, or VHDL, or architecture from bottom to top.
<ousado>
it's impossible to make general statements about who learns what, when, where, how good and all that.
<whitequark>
none of that matters that much, and none of that helps you to be a better software developer.
<jdoles>
whitequark: the mind-set that you can build on fundamentals and have no need to use whatever someone else has developed if it is not good enough.
<Drup>
ggole: any programmer *must* have a basic knowledge on computer science, because it is useful for everything
<whitequark>
jdoles: I don't think that is a good mind-set for practical tasks.
<whitequark>
Well, your statement is somewhat ambiguous.
<jdoles>
whitequark: it's not about whether you will, it's whether or not you can when needed.
<whitequark>
Being able to design a system without inherently relying on someone else's work is good: it highlights true understanding.
<whitequark>
jdoles: ah, right.
<whitequark>
yes, I agree with that.
<whitequark>
I would say that it is a side effect of systemic way of thinking.
<ggole>
Yes, it's good to be able to write, say, a red-black tree if you needed to
<ggole>
Even though you never will
<jdoles>
I can currently not tell you how a red-black tree works exactly.
<jdoles>
But I have read it before, and I understood it in detail.
<whitequark>
ggole: I never thought I will need to write a compiler for my day job in web-development, until it turned out that I have to write one.
<jdoles>
If I need to implement one, I can easily do so.
<ggole>
You understand that it is a tree of nodes, there's an ordering, and there's a logic to keep it balanced?
<ggole>
Compilers are a bit different. There's so much detail.
<whitequark>
Oh, and talking about web development again, which is presumably one of the disciplines most distant from anything CS-related or formal... yes, you do have to understand data structures.
<jdoles>
Still, the chance of red black trees still being optimal today is close to zero.
<whitequark>
And you have to understand them well.
<ggole>
You have to really love data structures to be happy writing a compiler.
<whitequark>
Otherwise, your database will grind to a halt.
<whitequark>
ggole: elaborate?
<jdoles>
Datastructures have developed over the past 10 years to match current hardware.
<jdoles>
As such, implementing any old structure is nothing more than an exercise and not useful.
<Drup>
jdoles: for a certain definition of optimiality, it is
<ggole>
jdoles: yeah, for example C++'s map is rather slow because there can be no contiguity
<ggole>
You can beat it quite easily
<ggole>
Even with a simple one-day toy implementation
<jdoles>
ggole: there can be no contiguity? Why not?
<ggole>
map promises address stability
<ggole>
So you cannot move something to be in a good location
<ggole>
It is utterly forbidden, dooming map (and set) to being slow.
<ggole>
(Also means lots of allocations.)
<jdoles>
Is there nothing like a fast_map then?
<ggole>
Not in the stdlib.
<ggole>
Of course you could write your own (google did a library recently?)
ocaml_newbie has quit []
<ggole>
It's an interface problem: you have to change the interface to be able to get the win.
<ggole>
And there's lots of code depending on the existing interface.
<bernardofpc>
I could probably unwind the loops in a max-function with two accumulators, but I'm not sure it's more readable, in fact
<ggole>
Anyway, all of this supports your claim that red-black trees are a bad idea on modern hardware.
<whitequark>
ggole: Writing a compiler can mean different things. LLVM is built around excellent data structures, for example.
<whitequark>
ggole: You don't need to delve into such detail as you go to higher levels.
<whitequark>
(often)
<whitequark>
Do I remember it right that you write your own codegen? That explains it :)
<ggole>
whitequark: if you are implementing the data-flow stuff, and the register allocator, and all of that junk, you will work with many interesting data structures.
<ggole>
So you kind of have to like it.
<ggole>
In some kinds of code, you have arrays and lists and maps and that's it. Boring.
<ggole>
Compilers aren't like that. :)
<whitequark>
Arrays and lists and maps (and graphs) can be enough for a certain kind of compilers.
<whitequark>
Not sure why are we having this argument, though.
<Drup>
you won't do a lot of things without some graph cleverness in a compiler :D
* whitequark
goes back to code
<whitequark>
Drup: oh, graphs, indeed.
<whitequark>
compiler is a graph manipulation machine :)
<ggole>
And bitvectors and union-find and etc, etc
ulfdoz has joined #ocaml
<pippijn>
btw, the best bitset for ocaml I have found is in menhir's source
<pippijn>
I use it in my code, too
<ggole>
I have a crappy one built on string.
<pippijn>
it's a sparse int set
<pippijn>
ggole: yeah, that's crappy
<pippijn>
my code is pure
<pippijn>
and so the data structure is persistent
<pippijn>
and fast
<ggole>
Yeah, string is only good for mutable bitvectors
<ggole>
And not great for that
<pippijn>
because I need to copy the bitset quite often
<pippijn>
copy and change
<Drup>
pippijn: extract it and put it into is own library ? :)
<pippijn>
I used to have an std::vector<bool>
<pippijn>
Drup: it's 1 file (and its .mli
<pippijn>
)
<Drup>
his*
<pippijn>
you can just get it from the menhir sources
<pippijn>
copying the vector took so much time
<Drup>
if you know that's here, probably yes
<pippijn>
I have implemented some standard library things for myself..
<pippijn>
or "stolen"
<pippijn>
(of course with licence intact)
<pippijn>
I should publish them
<ggole>
I implemented extensible arrays too
<pippijn>
I use bits of batteries and some things of my own
<ggole>
Since there's nothing in the stdlib
<Drup>
having a lot of small library is not a problem anymore
<ggole>
Felt kind of silly
<pippijn>
BatDynArray is ok
<ggole>
I was using nothing but the stock installation at the time
<pippijn>
but its flexibility costs time, so I had my own, too
<pippijn>
because I need one in high performance code :\
<pippijn>
yeah, I know.. don't say it
<ggole>
It's a bit annoying to have the double indirection compared to arrays
<pippijn>
yes
<Drup>
(and Batteries, even if great, doesn't compile to js)
<pippijn>
Drup: it does
<pippijn>
wait
<pippijn>
no it doesn't
<pippijn>
that's indeed a problem I faced some time ago
<ocaml_newbie>
so Sqlite exec executes the select statement, the output of this statement is forwarded to lister which is probably type unit, and saves the results of the statement to code?
<wmeyer>
pippijn: very long time ago, and never been integrated to any language
_habnabit has joined #ocaml
derek_c has joined #ocaml
dsheets has quit [Ping timeout: 248 seconds]
<amiller_>
so i'm using this compiler-libs-hack blogpost and it's working well
<amiller_>
but now i want to do benchmarks on my generated code so i want to use ocamlopt instead of ocamlc
<amiller_>
does compiler libs help with that too?
<amiller_>
basically this effort began with modifying compile.ml
<wmeyer>
amiller_: you have to link to .cmxa, but if you use ocamlfind it should be seamless
<gasche>
amiller_: look at compileopt.ml
<gasche>
optcompile.ml, sorry
* wmeyer
should first read the question ... tired.
<amiller_>
ah optcompile
ggole has quit []
ygrek has quit [Ping timeout: 264 seconds]
<wmeyer>
amiller_: can I ask, what are you working on, that requires this?
<wmeyer>
amiller_: just out of curiosity
<amiller_>
wmeyer, it's a compiler for authenticated datastructures
<amiller_>
you take an ordinary program and compile it twice, two different ways, one for a Client and one for an untrusted Server
<wmeyer>
amiller_: and you need custom driver for that?
<amiller_>
basically the client replaces all the data structures with just sha1 hashes
<amiller_>
so the client only has to have O(1) tiny amount of storage and it reads bits of data from the untrusted prover on demand
<amiller_>
wmeyer, well i basically need to do two passes where i look at the typedtree to observe inferred types and then make modifications in the untyped parsetree
<wmeyer>
make sense
<amiller_>
it's not enough to just look at the syntax or i could use a pp mapper
<amiller_>
and i think it's jsut too confusing to modify the typedtree in place
<wmeyer>
yes it is
<amiller_>
but i think that sort of infrastructure is almost in place where i wouldn't need to modify the driver and would just splice along the typedtree so i can look forward to that
<amiller_>
ok cool :D
emmanuelux has joined #ocaml
ollehar has quit [Ping timeout: 240 seconds]
<wmeyer>
it's difficult to support meta programming using typed tree, therefore Alain Frisch went for the AST only
<wmeyer>
attempts made in Fan to support typed meta programming, AFAIK, boiled down to conclusion that typing incrementaly is too slow for pratcical usage. (although the OCaml type checker is relatively fast, if not one of the fastest around)
osnr has quit [Quit: Leaving.]
<amiller_>
hrm this is not working so well
<amiller_>
i need asmgen.cmo which is not in compiler-libs
<amiller_>
i found it in asmcomp
<wmeyer>
sure you need a code generator too
ocaml_newbie_sav has joined #ocaml
<amiller_>
though now i get Error: Files main.cmo
<amiller_>
and /usr/local/lib/ocaml/compiler-libs/ocamlbytecomp.cma(Compile)
<amiller_>
make inconsistent assumptions over interface Compile
<amiller_>
hm
<wmeyer>
i think compiler-libs just give a most of the frontend stuff
<gasche>
amiller_: this is because you named your own module Compile, I suppose
<gasche>
so you have a module-name conflict
<gasche>
if that is it, use "mycompile.ml" and the problem should go away
ocaml_newbie has quit [Ping timeout: 256 seconds]
<amiller_>
i should be using optmain instead of main in any case
<amiller_>
okay
beckerb has quit [Ping timeout: 245 seconds]
Anarchos has joined #ocaml
<amiller_>
ah okay i didn't pay attention to something in the blogpost it did show the way
<amiller_>
i needed to reaplce ocamlbytecomp.cma with ocamloptcomp.cma and also main.ml with optmain.ml
<pippijn>
wmeyer: is it good?
<wmeyer>
pippijn: I don't know, it requires a lot of work be in the final stage, though
<wmeyer>
it meant to be embedded in some language, but I did just some basic checks
<wmeyer>
and it's not complete, for instance does not cover the cases where the older heap references young heap
<wmeyer>
so it's a good starting point, but requires some work. Not mentioning tuning it.
<wmeyer>
just look at the tests, that will give you some flavour
<wmeyer>
it was one or two day of work maybe
<pippijn>
ok
<wmeyer>
didn't spend any time debugging it even, but i have it, so feel free to steal some ideas
<wmeyer>
(if there are any interesting ideas at all in it)
<pippijn>
maybe someday
<wmeyer>
cool
<pippijn>
wmeyer: how is coq going?
<wmeyer>
pippijn: it's going fine, apart I have no energy to do this, these days
* wmeyer
lacks of energy for anything at the moment
<troydm>
coq <- i always laught at pronouncing that :)
<wmeyer>
pippijn: I bought a book, Coq' art
<wmeyer>
yes it's funny :-)
<wmeyer>
troydm: can say to my coleagues, Coq brings it to another level of understanding :-)
<wmeyer>
(maybe I am wrong, i don't remember where i got that information)
structuralist has joined #ocaml
derek_c has quit [Ping timeout: 264 seconds]
<wmeyer>
pippijn: you definitely can look into Coq, if you like OCaml and want more
walter|r has joined #ocaml
<pippijn>
hmm
<pippijn>
I was put off a little by the ascii list string
walter has quit [Ping timeout: 246 seconds]
<wmeyer>
pippijn: this is because Coq is pure, but could be better with ropes
<wmeyer>
well nat is even worse, it's a list
<ousado>
wmeyer: hey :)
<wmeyer>
S (S (S O)) is 3
<wmeyer>
ousado: ho! :)
<pippijn>
yeah, nat :\
<ousado>
wmeyer: I'm about to write a GC
<wmeyer>
but most of the time in high performance applications like compilers you can get the decent performance
<pippijn>
how?
<ousado>
wmeyer: and I want to try region inference
<ousado>
and my head is spinning
<wmeyer>
pippijn: as an array of bits?
<pippijn>
ok
<pippijn>
really?
<wmeyer>
ousado: nice. I'd look into ocaml runtime if I were you
<wmeyer>
pippijn: yes
<wmeyer>
how can you in other means support proving anything with it?
<pippijn>
they implement nat as (bool * bool * bool * ...)?
<ousado>
wmeyer: does ocaml do region inference?
<wmeyer>
no, nat is:
<pippijn>
I know nat
<pippijn>
I mean when you want high performance
<pippijn>
how do you get high performance with integers?
<pippijn>
or even decent performance
<wmeyer>
yes, then it's a tuple of bools AFAIK.
<pippijn>
and in ocaml?
<pippijn>
still a tuple of bools?
<wmeyer>
you can do custom extraction, or you don't rely on the integral numbers arithmetic
<pippijn>
how do you not rely on that?
<wmeyer>
I think for literals yes, but for the operations you can do whatever you want after conversion
<wmeyer>
for instance in CompCert as far as I remember reading Xavier Leroy's post on Coq-club all the keywords and names are ints after lexing pass (this is regarding strings in Coq)
<wmeyer>
so Coq does not use too much string operations (if any)
<wmeyer>
again, this is not something I verify at the moment, but I think it's like this
<pippijn>
ok
<pippijn>
if I were to use coq, I would probably want to rewrite a single module in some program of mine in it
<wmeyer>
this is just a part of runtime that has to be written in assembly (routines like exception stack frames un-winding)
zpe has quit [Remote host closed the connection]
<wmeyer>
but byterun/ is where you would look first
<ousado>
doh, alright..
zpe has joined #ocaml
<wmeyer>
so they stacked, this is part of the beauty of the architecture, that some parts are used by the byte compiler with an overlap for the native compiler
ontologiae_ has joined #ocaml
ollehar has joined #ocaml
Kakadu has joined #ocaml
ollehar has quit [Ping timeout: 276 seconds]
ollehar has joined #ocaml
<gasche>
if I remember correctly, region *inference* is considered to be a failure by people having worked on that
<gasche>
(by that I mean that despite its promises, it could never actually replace tracing GCs as a memory managment technique)
<gasche>
there is a after-the-fact paper bringing some conclusions from the SML experiments
<gasche>
so I maybe wouldn't call it an "optimization"
<gasche>
that said (1) the door is still open to good hybrid approaches (2) there are explicit region systems (no inference) that work well, but you manage memory explicitly
Drup has joined #ocaml
jathd has joined #ocaml
<bernardofpc>
wmeyer: Coq has no "native int" in it ? I thougth that the exercise for TwoN / TwoNp was precisely for this kind of conversion
<bernardofpc>
(or maybe that's what you said in "bool array", and the end of the list would be Zero)
<gasche>
when you extract a program from Coq to OCaml, you are allowed to substitute primitive OCaml types for whatever Coq datatypes were used in the formalization
<gasche>
the consequences on safety must be properly understood (that is very much an "escape hatch" that allows you to break proofs), but this allows to handle a lot of performance worries of the form "what's the behavior of Coq's representation of X"
<gasche>
for example, while Coq "chars" are actually represented as octuplet of bools, it's customary to extract them to OCaml's "char" datatype
q66 has quit [Remote host closed the connection]
<orbitz>
is char guarnatented to be an octet?
<orbitz>
If not, can I determine how many bits a char is in ocaml?
Kakadu has quit [Ping timeout: 246 seconds]
Kakadu has joined #ocaml
tani has quit [Quit: Verlassend]
Neros has joined #ocaml
ohama has quit [Ping timeout: 260 seconds]
<gasche>
orbitz: "Character values are represented as 8-bit integers between 0 and 255" from the manual
<orbitz>
swell
walter|r has quit [Read error: Connection reset by peer]
ohama has joined #ocaml
walter|r has joined #ocaml
<Drup>
Am I the only one to have an issue with darcs on the forge ?
<rgrinberg>
gasche: how come no streams? implementation is incomplete or it's still uncertain whether the feature will make it
<rgrinberg>
also how do you compile code that uses the Stream module?
ulfdoz has quit [Read error: Operation timed out]
<pippijn>
wmeyer: ok, that mail is helpful
rwmjones has quit [Ping timeout: 240 seconds]
Kakadu has quit []
Watcher7|off is now known as Watcher7
walter|r has quit [Read error: Connection reset by peer]
walter|r has joined #ocaml
walter|r has quit [Read error: Connection reset by peer]
walter|r has joined #ocaml
rwmjones has joined #ocaml
zpe has quit [Remote host closed the connection]
dsheets has joined #ocaml
gnuvince has quit [Ping timeout: 240 seconds]
Anarchos has quit [Quit: good night to all]
ben_zen has joined #ocaml
ollehar has quit [Ping timeout: 256 seconds]
derek_c has joined #ocaml
ollehar has joined #ocaml
chrisdotcode has quit [Remote host closed the connection]
chrisdotcode has joined #ocaml
ontologiae_ has quit [Ping timeout: 264 seconds]
tobiasBora has joined #ocaml
astertronistic has quit [Quit: Leaving]
thomasga has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 255 seconds]
ollehar has quit [Ping timeout: 256 seconds]
tobiasBora has quit [Quit: Konversation terminated!]
derek_c has quit [Quit: Lost terminal]
thomasga has quit [Quit: Leaving.]
Neros is now known as personne
personne has quit [Remote host closed the connection]