adrien 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-lang.org | Public logs at http://tunes.org/~nef/logs/ocaml/
emmanuelux has quit [Remote host closed the connection]
ikaros has quit [Quit: Ex-Chat]
pkrnj has joined #ocaml
eikke has quit [Read error: Operation timed out]
eikke has joined #ocaml
avsm has joined #ocaml
avsm has quit [Ping timeout: 260 seconds]
lolcathost has quit [Ping timeout: 265 seconds]
lolcathost has joined #ocaml
lolcathost has quit [Changing host]
lolcathost has joined #ocaml
lolcathost has quit [Client Quit]
lolcathost has joined #ocaml
lolcathost has quit [Changing host]
lolcathost has joined #ocaml
madroach has quit [Ping timeout: 244 seconds]
avsm has joined #ocaml
walter has quit [Quit: This computer has gone to sleep]
madroach has joined #ocaml
avsm has quit [Ping timeout: 255 seconds]
myx has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
eikke has quit [Ping timeout: 268 seconds]
eikke has joined #ocaml
lolcathost has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
avsm has joined #ocaml
dskippy1 has quit [Ping timeout: 252 seconds]
eikke has quit [Ping timeout: 252 seconds]
avsm has quit [Ping timeout: 252 seconds]
jamii has joined #ocaml
jamii has quit [Remote host closed the connection]
jamii has joined #ocaml
thelema has quit [Ping timeout: 260 seconds]
thelema has joined #ocaml
astertronistic has joined #ocaml
avsm has joined #ocaml
avsm has quit [Ping timeout: 252 seconds]
pkrnj has quit [Quit: Computer has gone to sleep.]
wormphlegm has quit [Read error: Connection reset by peer]
wormphlegm has joined #ocaml
spherox has quit [Ping timeout: 264 seconds]
lolcathost has joined #ocaml
cdidd has joined #ocaml
lolcathost has quit [Ping timeout: 255 seconds]
lolcathost has joined #ocaml
lolcathost has quit [Changing host]
lolcathost has joined #ocaml
lolcathost has quit [Client Quit]
avsm has joined #ocaml
avsm has quit [Ping timeout: 252 seconds]
pkrnj has joined #ocaml
<gustav__> How do I make a table with ocsigen? This won't work: (body [table [tr [td [pcdata "test"]]]]).
<gustav__> Why can't I just put HTML in it instead of long complicated lists? :C
<gustav__> Deep lists.
<gustav__> I'm better at HTML than the API. :/
jamii has quit [Ping timeout: 245 seconds]
lolcathost has joined #ocaml
lolcathost has quit [Changing host]
lolcathost has joined #ocaml
<gustav__> Grr...
avsm has joined #ocaml
<gustav__> <body><table><tr><td>a</table></body> is valid but (body (table (tr (td (pcdata "a"))))) is not?
rhodesd has left #ocaml []
avsm has quit [Ping timeout: 264 seconds]
lolcathost has quit [Ping timeout: 245 seconds]
lolcathost has joined #ocaml
<gustav__> Talk.
<gustav__> Right. I'll do something else then.
lolcathost has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
<gustav__> And now I'm done...
leoncamel has quit [Quit: WeeChat 0.3.9.1]
Haseo has quit [Ping timeout: 244 seconds]
Haseo has joined #ocaml
Yoric has joined #ocaml
mjonsson has quit [Ping timeout: 245 seconds]
avsm has joined #ocaml
avsm has quit [Ping timeout: 252 seconds]
jave has quit [Ping timeout: 245 seconds]
rwmjones has quit [Read error: Operation timed out]
rwmjones has joined #ocaml
jave has joined #ocaml
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
thelema has quit [Ping timeout: 264 seconds]
lolcathost has joined #ocaml
lolcathost has quit [Changing host]
lolcathost has joined #ocaml
thelema has joined #ocaml
avsm has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
avsm has quit [Ping timeout: 240 seconds]
Cyanure has joined #ocaml
lolcathost has quit [Ping timeout: 260 seconds]
leoncamel has joined #ocaml
avsm has joined #ocaml
destrius has joined #ocaml
ulfdoz has joined #ocaml
lolcathost has joined #ocaml
avsm has quit [Ping timeout: 252 seconds]
andreypopp has joined #ocaml
pango is now known as pangoafk
dwmw2_gone has joined #ocaml
ulfdoz has quit [Read error: Connection reset by peer]
ulfdoz has joined #ocaml
avsm has joined #ocaml
ulfdoz has quit [Ping timeout: 265 seconds]
Cyanure has quit [Remote host closed the connection]
Neros has quit [Ping timeout: 260 seconds]
avsm has quit [Ping timeout: 240 seconds]
mindbender1 has quit [Ping timeout: 252 seconds]
mindbender1 has joined #ocaml
Cyanure has joined #ocaml
Kakadu has joined #ocaml
hkBst has joined #ocaml
mfill has joined #ocaml
mfill has quit [Client Quit]
avsm has joined #ocaml
ocp has joined #ocaml
avsm has quit [Ping timeout: 265 seconds]
astertronistic has quit [Quit: Leaving]
andreypopp has quit [Quit: sleep]
sgnb has quit [Remote host closed the connection]
sgnb has joined #ocaml
lolcathost has quit [Quit: Lost terminal]
djcoin has joined #ocaml
sgnb has quit [Remote host closed the connection]
sgnb has joined #ocaml
sgnb has quit [Remote host closed the connection]
sgnb has joined #ocaml
sgnb has quit [Remote host closed the connection]
Snark has joined #ocaml
sgnb has joined #ocaml
<mehdid> gustav__: fwiw, yours doesn't type because it doesn't match the ocaml type
<mehdid> table needs a first row, and then a list of rows
<mehdid> so "table (tr ...) []" should work (note the [] at the end)
Yoric has joined #ocaml
chambart has joined #ocaml
fraggle_ has quit [Ping timeout: 260 seconds]
cago has joined #ocaml
ontologiae has joined #ocaml
ontologiae has quit [Client Quit]
ontologiae has joined #ocaml
Kakadu has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
lolcathost has joined #ocaml
Kakadu has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
Kakadu has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
ontologiae has quit [Quit: leaving]
Kakadu has quit [Read error: Connection reset by peer]
ontologiae has joined #ocaml
eikke has joined #ocaml
Kakadu has joined #ocaml
mindbender1 has quit [Quit: Leaving.]
xavierm02 has joined #ocaml
fusillia has joined #ocaml
sepp2k has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
larhat has quit [Quit: Leaving.]
andreypopp has joined #ocaml
fraggle_ has joined #ocaml
thelema has quit [Read error: No route to host]
thelema has joined #ocaml
avsm has joined #ocaml
andreypopp has quit [Read error: Connection reset by peer]
andreypopp has joined #ocaml
andreypopp has quit [Read error: Connection reset by peer]
<gustav__> mehdid: Aha. Implemented the site in PHP instead. :-)
BiDOrD has joined #ocaml
BiDOrD_ has quit [Read error: Operation timed out]
Xizor has joined #ocaml
ftrvxmtrx has joined #ocaml
andreypopp has joined #ocaml
andreypopp has quit [Client Quit]
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
ikaros has joined #ocaml
ikaros has quit [Client Quit]
deu5 has joined #ocaml
ikaros has joined #ocaml
andreypopp has joined #ocaml
Kakadu has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
leoncamel has quit [Quit: WeeChat 0.3.9.2]
leoncamel has joined #ocaml
larhat has joined #ocaml
mye has joined #ocaml
thelema has quit [Read error: Operation timed out]
leoncamel has quit [Quit: WeeChat 0.3.9.2]
leoncamel has joined #ocaml
destrius has quit [Quit: Leaving.]
fusillia has quit [Ping timeout: 260 seconds]
fraggle_laptop has quit [Ping timeout: 252 seconds]
Cyanure has quit [Remote host closed the connection]
fraggle_laptop has joined #ocaml
avsm has quit [Quit: Leaving.]
djcoin has quit [Ping timeout: 276 seconds]
Kakadu has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
Kakadu has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
thelema has joined #ocaml
avsm has joined #ocaml
avsm has quit [Ping timeout: 260 seconds]
Xizor has quit []
mjonsson has joined #ocaml
chambart has quit [Ping timeout: 246 seconds]
iratsu has joined #ocaml
djcoin has joined #ocaml
avsm has joined #ocaml
beckerb has joined #ocaml
madroach has quit [Quit: Lost terminal]
madroach has joined #ocaml
deu5 has quit [Remote host closed the connection]
avsm_ has joined #ocaml
mfill has joined #ocaml
fraggle_laptop has quit [Ping timeout: 255 seconds]
<pippijn> how is timely destruction usually implemented in ocaml?
thomasga has joined #ocaml
<pippijn> for example cleanup of I/O channels
<pippijn> right now, I return a cleanup function along with the channel, which is explicitly called when the channel is no longer used
<pippijn> in general, how is resource management done in ocaml?
<Kakadu> hey. Do you know how to get current date and time?
<pippijn> Unix module has things for that, I think
svenl has quit [Ping timeout: 260 seconds]
<Kakadu> {Unix.tm_sec = 12; Unix.tm_min = 57; Unix.tm_hour = 12; Unix.tm_mday = 20; Unix.tm_mon = 10; Unix.tm_year = 112; Unix.tm_wday = 2; Unix.tm_yday = 324; Unix.tm_isdst = false}
<Kakadu> It seems it is Grinvich
<Kakadu> and year = 0 is 1900
<Kakadu> it is not system time
fraggle_laptop has joined #ocaml
<rixed> pippijn: I usually use GC cleanup callbacks but it's not always a good idea
<pippijn> rixed: that doesn't do timely destruction
<pippijn> it does nondeterministic destruction
<pippijn> and I need timely destruction
<rixed> pippijn: you need destruction after a fixed time ?
<pippijn> in a deterministic moment
<rixed> pippijn: ok, never encountered this use case in ocaml.
<rixed> pippijn: I'd probably have a destructor thread waiting for a conditional variable so that the user can destroy everything at once with little fuss
<rixed> pippijn: but it all depends on the resource at hand I guess
<pippijn> okay
<pippijn> well, files are possible with finalisers
<pippijn> but think about this:
avsm1 has joined #ocaml
svenl has joined #ocaml
<pippijn> a resource system that is connected to a network server
avsm has quit [Ping timeout: 260 seconds]
avsm_ is now known as avsm
avsm2 has joined #ocaml
avsm1 has quit [Ping timeout: 240 seconds]
<pippijn> you can register resource handlers
gnuvince has quit [Ping timeout: 244 seconds]
myx has joined #ocaml
<pippijn> and on registering them, you get a handle to that resource handler
<flux> there should be a reference-counter-resource-monad!
<flux> not sure how the increment/decrement would work, though :)
<pippijn> when you want to unregister the handler, you tell the resource framework to unregister the one associated with the handle you got
<pippijn> refcounting is kind of what I need, yes
<pippijn> in some cases, you know exactly when the handler is unregistered
<pippijn> that would mean the refcount is always 1
<pippijn> but the people there don't seem to know what SBRM is about, assuming it means lexical scoping
<pippijn> and lexically scoped resources are easy in ocaml (with_dispose)
<pippijn> my question is about resources that escape their creation site
myx has quit [Ping timeout: 252 seconds]
<gustav__> http://www.nyvell.se/tiforum/ <- Site (now) implemented in PHP. I am probably going to port it to OCaml if I get the inclination. A lot of libraries and functions (not meaning OCaml meaning) seems to be work in progress. For example netcgi2. I thought OCaml was an old language? :)
<gustav__> (Language meaning ecosystem.)
<companion_cube> it has a relatively small ecosystem, sadly
<companion_cube> but if you want to write websites, take a look at ocsigen
<gustav__> Yes, I have but I got stuck. Writing HTML in a special form is tedious. When you want fast results. I know the benefits, but, yeah.
<gustav__> Rapid, rapid, rapid.
<gustav__> I've liked/loved ASP/PHP "style" web programming since the beginning when ASP came. I think I was in the beginning...
<gustav__> I don't really think big PHP documents become/are hard to read... you just have to read it. It's advanced programming...
<flux> I've many times restarted in ocsigen, and it's always about browsing and browsing manuals
<flux> not so with Perl & CGI :)
<gustav__> It's about the easy inclusion of HTML, I think. It's easy in Perl, too. When you just want it done.
<gustav__> Problem is OCaml has big benefits, too, so you sorta kinda want it too.
myx has joined #ocaml
<gustav__> Maybe some middle layer...........
<gustav__> Compute in OCaml -> Post process in PHP...
<gustav__> But PHP does more than post process. The problem with netcgi2, I had, was it didn't handle parameters correctly/adequately. I think oscigen does.
<gustav__> I should say templating in PHP.
<flux> how netcgi2 doesn't handle parmaeters correctly/adequately?
<gustav__> When I did a GET on a page where I read POST (I do right now, it's online) the GET data disappeared. So I lost that...
<flux> I've actually done some netcgi2 services, and it's been a relatively similar experience to using Perl CGI
<flux> hmm, quite strange that GET data could disappear, given it comes in an environment variable
<gustav__> There's a get_param function, somewhere, I used.
<flux> my page doesn't appear to use it (but it uses both GET and POST parameters; not sure if it uses them concurrently, though)
<flux> here's the page, btw: http://www.modeemi.fi/murmelo/
<gustav__> Cute name. xD
<flux> Modeemi URl MEga Logging bot/page
<flux> you can maybe guess that it's a backronym..
<gustav__> How safe is MD5 nowadays? (I see you use it.) I've recently become aware of MD5 DATABASES, with solved/paired, keys. :)
<gustav__> Aah.
<flux> personally, I'm not worried about that password database, but not a bad idea to upgrade it
<gustav__> Running out of options, sort of. :)
<flux> a user of this system can change this via irc with a /msg without further authentication
<flux> actually, maybe I could just open tagging for everyone, even people who haven't authenticated..
<flux> that's the only service the page currently provides for authenticated users
<gustav__> If it doesn't take too much resources (storage) or let's user do possibly dangerous (to the system) actions I don't see why there should be authentication. You already get some kind of authentication, I guess... the nicknames.
<gustav__> "lets"
<flux> well, in principle adding free tagging would allow spamming the page
<gustav__> Yes, exactly.
<flux> and it's not easy to undo that at the moment
<gustav__> It wouldn't be good idea in #Ubuntu, for instance.
<flux> in principle2 there is a way to revert operations
<gustav__> xd
<gustav__> xD
<flux> but iirc it doesn't cover tagging operations
<gustav__> I'm not sure what you mean by tagging. Tag an URL?
<flux> (there's a log of operations for reverting user netmask merging etc)
<gustav__> Oh, right, now I see.
<gustav__> Coding functions in PostgreSQL is a good idea, I think.
<gustav__> That sort of makes it, at least, more, implementation independent. Like, easier.
<gustav__> And you know the right thing happens.
<gustav__> Stored procedures.
<gustav__> At least gives you an option.
<gustav__> Options are great.
<flux> it also can tie you to postgresql, but I'm not kidding myself with being able, or even wanting to, switch databases :)
<rixed> pippijn: For your problem of resources, I got it now. Unfortunately I don't know of any espacially clever way to handle this. I'd do it à la C (manually unregistering the resources)
<gustav__> I realised before, what makes SQL so great. It has one write operation, one read operation, one change operation. A SELECT is _ALWAYS_ safe to do. A line of OCaml isn't always as relaxing. You don't always know what's going on behind the curtains. GC, even. Crazy insane stuff! :)
<pippijn> rixed: :(
<pippijn> rixed: if the handles can have multiple references, I need to implement manual refcounting?
<flux> select can actually be unsafe in postgresql.. :-)
<gustav__> flux: You're not that tied. I think PostgreSQL is pretty standard. Anyway, you just learned one more database. Can always go back to MySQL or whatever.
<gustav__> flux: Oh man. :(
<flux> case in point: look at the functions in murmelo.sql.. you call them with select
<gustav__> Ah, sure...
<gustav__> A subset, then. XC
<rixed> pippijn: I would say yes.
<pippijn> you've never had to handle external resources?
<pippijn> how do you handle them?
<pippijn> how do people handle external resources with multiple ownership in ocaml?
<rixed> pippijn: I'm not doing many client/server progs in OCaml.
<pippijn> how do you do it in other languages?
<rixed> pippijn: In C I'd ref count by hand
<flux> pippijn, if the resource lifetime is somehow non-deterministic, you'd use reference counting
<pippijn> flux: manually?
<flux> like in C as rixed says. but c++ and python are able to do it automaticlaly.
<flux> pippijn, it's not like I have a choice
<pippijn> sad..
<flux> and using GC finalizers is not a choice
<pippijn> indeed
<rixed> Or you use the GC finalizer to ref count for you, but you have to "flush" it by hand at some point.
<flux> if ocaml had linear typing, you would be able to guarantee that you properly update the reference count
<rixed> maybe using a custom block with hand crafter GC cost you can achieve something...?
<rixed> crafter/crafted
<flux> rixed, the problem is that it will be called too late
<pippijn> flux: right
<rixed> at the next minor heap full event.
<flux> and if you do GC too often, it will bring your performance down
<flux> in that time you are able to allocate 1000 file handles
<rixed> flux: not with the custom block trick
<flux> boom, otu of file handles
avsm2 has quit [Quit: Leaving.]
<gustav__> Do any of you have real influence over the OCaml source or is this like out-side speculation and wishing...? :-)
<pippijn> rixed: custom block doesn't do anything GC finalisers don't do
<pippijn> in this issue, that is
<rixed> pippijn: yep but you can ask the GC to finalize your custom block sooner than regular values
<gustav__> I wonder why I always want to influence a crew of programmers when there's something wrong with something. I could just branch and get my own flavour... Hmm. Must think about that.
<flux> rixed, how does that happen if GC doesn't even get called?
<gustav__> But I guess it's nice to get feedback.
* gustav__ talks to himself.
<flux> you can say that yeah, this file descriptor weights 10 megabytes, it should be release ASAP..
* gustav__ could even be a bot.
<Qrntz> I think this can be relevant to your problem
<flux> but is it a good idea to lie to GC :(
<flux> I think gc finalizers are only useful for memory-bound resources
<flux> file descriptors could be one, but sadly they are not in practice
djcoin has quit [Read error: Connection reset by peer]
<rixed> flux: I agree it's not a good idea to rely on GC, but it's not a very good idea to manually count references either :)
<flux> rixed, given those two options, though, I choose the latter
<flux> at least it is deterministic and testable
<rixed> flux: I'd probably choose tha later also
<flux> and you can build on them with 'with' kind of constructs. with reference_counter_resource (fun r -> ..) and then deal manually with incr_ref/decr_ref only when you cannot use the resource in a scoped fashion
<gustav__> I usually set the point to 0 when I'm done and closed and deallocated it. But maybe you're copying addresses.
<gustav__> point=pointer
<flux> and it is the scoped way when the GC approach alrady fails
<rixed> flux: in some other situations (loop) that's the ref counting that fails :-p
<gustav__> There should be a way to test an address/pointer if it's a valid address.
<gustav__> That information is available to the OS, at least.
<pippijn> The requested URL /~fpottier/publis/mezzo-tutorial-long.pdf was not found on this server.
<rixed> gustav__: there is a function to tell if an address belongs to OCAml heap in the runtime...
<flux> gustav__, you can see that in Linux. how were you planning to use that information?
<gustav__> Oh.
<gustav__> flux: With that I wouldn't need GC or reference counting. :-)
<flux> gustav__, not really following..
<flux> gustav__, note that once an address has become invalid, it can become valid again by someone allocating stuff
<pippijn> got it, thanks
<gustav__> I could just test the pointer if it's valid. But maybe it could point to some other, formally valid object... I don't know what the API would say about those addresses...
<gustav__> flux: Right.
<flux> gustav__, but, I have a solution..
<flux> we have 64 G address space
<flux> oops,
<flux> 64 bit
<flux> just never reuse an address!
<gustav__> Yep. I know. Exactly.
<flux> and when it runs out, restart the application
<gustav__> And at compile time, that doesn't matter. I think...
<flux> probably a fresh start is good at that point anyway.
<gustav__> xD
<gustav__> HAHAHA.
<gustav__> Oh no, it's one of those 640Kb is good enough for anyone moment.
<flux> too bad nobody is doing 128 bit architectures
<gustav__> SSE is 128bit... :C
<gustav__> Store pointers in SSE! :C
<gustav__> Wasn't SGI 128bit? MIPS?
<flux> well, you still don't have 128 bit virtual memory address space
<flux> I suppose you could do some form of paging
<gustav__> Exactly.
<gustav__> Yay, i7 is 128-bit!
<gustav__> Yaay.
<gustav__> If I made my own CPU architecture, would it end up on WP, you think? :)
mjonsson has quit [Ping timeout: 276 seconds]
djcoin has joined #ocaml
<gustav__> Would be crazy to have 128MByte registers. Those would be big.
<gustav__> Probably slow.
<pippijn> very slow
<gustav__> Guys and dolls making processor have probably thought about these things, from a speed approach.
<olasd> a 128MByte register is (more or less) called a RAM chip
<gustav__> It should probably be done anyway.
<gustav__> olasd: Yes, with some language magic, but in reality a register is something inside the processor.
<pippijn> Qrntz: yes, looks good
<pippijn> Qrntz: basically dynamic regions
chambart has joined #ocaml
<Qrntz> pippijn, right
<gustav__> I bet 64-bit is about how big you can make it, the physical amount of cables, so that you can actually do operations on it in any low amount of time.
<Qrntz> glad you liked it, it seems like an interesting project
<pippijn> yes
<pippijn> sadly, it doesn't exist
<pippijn> only as a type checker
<Qrntz> not yet
<olasd> gustav__: avx does fast operations on 256-bit registers
<gustav__> :3
<gustav__> Might be specifically fast in that case.
<gustav__> In xor operations 64-bit might be better. I don't know? I'm speculating.
<pippijn> xor is O(1)
<gustav__> Oh.
<pippijn> Qrntz: I like it
<gustav__> I wonder how/where it is O(1)...
<pippijn> gustav__: xor can be implemented in constant time and linear space
<gustav__> Yes, but I mean hardware. But sure, that might be it.
<pippijn> because the bits can all be xor'ed independently
<pippijn> yes, I also mean in hardware
<gustav__> That stuff probably executes at the speed of an electron.
<pippijn> not that fast
<pippijn> it executes at the speed of the clock
<gustav__> Hmmm...
<pippijn> 2GHz for example
<gustav__> Gotta love that clock.
<gustav__> But the clock blocks it, when it executes it, it's the speed of electron.
<gustav__> Swooosh!
<pippijn> not that fast :)
<pippijn> it still needs to charge transistors
<pippijn> it takes several electrons to do that
<gustav__> Okay.
<pippijn> I guess having large registers helps when you add large numbers
<pippijn> a carry-look-ahead-adder needs O(log n) time (and n space)
<pippijn> no
<pippijn> n log n space
<gustav__> Probably large registers aren't that interesting. But people look droolingly at larger registers because you can have sooo muuuch RAAAM...
<pippijn> carry-select needs sqrt n time and n space
<gustav__> I think people confuse memory with money. Money is good to have. Memory not so sure.
<gustav__> Those damn economists. Always want more of everything.
<pippijn> hmm
<pippijn> 2^64 = approx. 1.8446744E19
<pippijn> how much is that?
<pippijn> I don't think 64 bit CPUs actually have a 64 bit address space
<gustav__> 18446744000000000000.
<pippijn> 8.796093E12 is the limit, I think
<pippijn> at least at the moment
<pippijn> oh
<pippijn> more
<pippijn> 44 bit
<gustav__> Is 64-bit enough to address all the data on the planet? Is that how they measure the need, maybe?
<pippijn> "AMD therefore decided that, in the first implementations of the architecture, only the least significant 48 bits of a virtual address would actually be used in address translation (page table lookup)"
<gustav__> What does exactly hyperthreading mean? Are they virtual or not?
avsm1 has joined #ocaml
<gustav__> Does my hardware have 8 cores or 4? :) I remember, 8 are visible to the OS...
<gustav__> So it's like hardware implemented pseudo multicore... ehm.
<pippijn> gustav__: hyperthreading means you have twice as many registers
answer_42 has joined #ocaml
<gustav__> You could maybe say that...
<flux> including Program Counter registers :)
<gustav__> But all registers aren't accessible from one program. o_o
<gustav__> Ehm...
<gustav__> You ARE crazy.
<pippijn> HTT is useful for a single process to use multiple cores
<pippijn> the operating system does that for you
<pippijn> if it doesn't, your performance will in fact be lower
<flux> gustav__, the thing is, there is only so many uses for a register in a program. for two programs you can probably find use :)
mye has quit [Quit: mye]
<pippijn> actually two threads
<pippijn> if they don't share the address space, hyper threading becomes slow
<pippijn> (from what I understood, but my knowledge here is 5 years old)
<gustav__> Cores, not threads, share some cache now. That's promising. Somehow.
<gustav__> (Not threads mean I don't know.)
<pippijn> hyper threading does not magically create more processing power
<pippijn> you know about pipelined architectures?
<gustav__> Yes, I think so.
<pippijn> if you have this code:
<pippijn> a = 3
<pippijn> b = 4
<pippijn> c = a + b
<pippijn> then the first two instructions are independent and can be executed in parallel
<gustav__> Yeah.
<pippijn> where "executed" means decoding/scheduling/whatnot whatever the pipeline does
avsm1 has quit [Quit: Leaving.]
<gustav__> Prefetch, decode, execute.
<pippijn> and more
<gustav__> Go for a beer.
<pippijn> depending on the architecture
<pippijn> maybe 7 steps
<pippijn> anyway
<pippijn> hyper threading simply merges instruction streams from 2 threads
avsm1 has joined #ocaml
<pippijn> so that you have more independent instructions
<pippijn> that can potentially be prefetched/decoded in parallel
<pippijn> got it?
<gustav__> Maybe.
<gustav__> It merges?
<pippijn> thread 1 does this:
<pippijn> a = 3
<pippijn> b = a + 1
<pippijn> thread 2 does this:
<pippijn> a = 4
<pippijn> b = a + 2
<gustav__> AAAH. So it has nothing to do with UNIX threads?
<pippijn> you can execute these on separate cores
<pippijn> but the CPU will be idling most of the time
<pippijn> because b depends on a
<gustav__> It operates on one program. Got it.
<pippijn> so it can't load the result from a yet
<pippijn> gustav__: it does have to do with unix threads
<pippijn> thread 1 and 2 are real threads
<pippijn> ok, better this:
<pippijn> thread 1 does:
<pippijn> a = 3; b = a + 1
<pippijn> thread 2 does:
<pippijn> c = 4; d = c + 2
<pippijn> hyper threading merges these two threads into a single thread, so it can execute on a single physical core
<pippijn> because that physical core would be bored by thread 1
mfill has quit [Quit: leaving]
<pippijn> the pipeline would be blocked by waiting for the result of a = 3
<pippijn> it could start decoding some of thread 2's instructions
<gustav__> o_o
<gustav__> You seem to be mixing a lot. Your threads don't block even.
eikke has quit [Read error: Operation timed out]
<pippijn> ok
<pippijn> so let's ignore the threads
<pippijn> here is a program:
<pippijn> a = 3
<pippijn> b = a + 1
<pippijn> c = b + 1
<pippijn> ok?
<pippijn> what does your CPU do here?
<gustav__> I'm not sure you're an authoritative source. Can you point me to an Intel document, maybe?
<pippijn> let's say the pipeline is 2 levels deep: prefetch/decode and execute
<pippijn> gustav__: charming..
Cyanure has joined #ocaml
<gustav__> Hyperthreads show up as individual processors in Linux, so I think the OS has some kind of multiprocessor access to them, i.e. execute separate programs on them without any kind of mixing. I.e. two streams not having to do with each other.
<pippijn> ok
<pippijn> if you think that
<pippijn> then I'm done explaining
<flux> gustav__, but its scheduler is able to use that information
<flux> and apparently there are benefits in doing that
<gustav__> I think it has more to do with cache. Maybe.
<flux> that's probably correct. or what kind of other benefits can there be? are page misses faster when the mappings are smaller?
<gustav__> Are two programs cooperating, with memory access in the same region, SHM, whatever, then that should be kept in the same cache. And it can do that. So that that data can be processed without having to be accessed from RAM.
<pippijn> it has certainly to do with cache
<pippijn> but that's a side-effect of what I was trying to explain
<pippijn> cache misses cause the processor to idle for many hundreds or even thousands of clock cycles
<pippijn> hyper threading reduces the pain of that by overlaying another instruction stream onto the pipeline
<pippijn> but you seem to know it better than me, anyway
<pippijn> so enjoy your knowledge
UncleVasya has joined #ocaml
milosn has quit [Ping timeout: 245 seconds]
<gustav__> "Hyper-threading is a form of simultaneous multi-threading that takes advantage of super scalar architecture (multiple instructions operating on separate data in parallel). They appear to the OS as two processors, thus the OS can schedule two processes at once. In addition two or more processes can use the same resources." "multiple instructions operating on separate data in parallel" <- WP.
<gustav__> SEPARATE data.
<pippijn> that is exactly what I said
<pippijn> 15:52 < pippijn> c = 4; d = c + 2
<pippijn> 15:52 < pippijn> a = 3; b = a + 1
<pippijn> a and c are separate data
<pippijn> and the operations on them (+2 and +1) are independent
<pippijn> so it can be executed in parallel
<pippijn> MIMD
<pippijn> superscalar means pipelined
<flux> while everyone here seems to know what hyperthreading is, here's a simpler example: one cpu, two threads, one thread does integer math, one does floating math, being scheduled 100 ms each. if there's hyperhtreading, both threads can run concurrently, thus within the 100 ms period they are able to use both integer and floating point units.
<flux> except really it's more fine grained than that.
<pippijn> yes
Neros_ has joined #ocaml
<gustav__> Aha. So sometimes, HT processors are concurrent? But mostly not.
<flux> it depends what you mean by 'concurrent'
<gustav__> Partial multicore?
<flux> even single-core non-ht processes are concurrent
<gustav__> They are operating at the same time.
<flux> they can do addition on two registers and division on two other registers in parallel
<gustav__> At the same instant.
<flux> in fact, that's why modern cpu's are so fast
<flux> what HT does it feeds those units inputs from two threads of execution instead of one
<pippijn> flux: they can even do two additions at the same time, if they have multiple adders (which is usually the case)
<flux> you need go back to microcontrollers to find processors that do only one thing at a time
<gustav__> ;_;
<flux> what HT does is that instead of picking stuff to feed to the n processing units from one thread of executing (doing just integer math, 50% idle among all cpu units) it can do it from two threads (doing integer math AND floating math, 100% load among all units)
<flux> of course, the better load among all CPU sub units, the better performance
<gustav__> So, how many things can my i7 processor do at one single point in time? 1000?
<flux> probably not quite
<flux> I'd say at least dozens
<pippijn> it depends on what "thing" means
<gustav__> Modify data.
<flux> if that involves writing to cache or memory, probably only one
<flux> I don't think you can write many things to memory simultaneously.
<gustav__> Registers contain data.
<gustav__> 1,2,3,...,64-bit
<flux> but you can modify stuff in registers
smondet has joined #ocaml
<gustav__> I could say that thing = word, then. That's a more common definition.
<flux> that kind of information may not be easily available
<pippijn> i7 has 14 pipeline stages
<flux> hmm, although I suppose it must be, for compiler optimization
<gustav__> O_O
<gustav__> 14 stages per hyperthread... A lot then.
<pippijn> no, per pipeline
<gustav__> 14 * 2 * 4 = 56.
<pippijn> ehm
<gustav__> How many pipelines does a hyperthread have?
<pippijn> what is a hyperthread?
<gustav__> Something that fetches instructions from another hyperthread's inputstream and executes it. By your definition.
<pippijn> a hyperthread is something that fetches instructions from another hyperthead's input stream?
<pippijn> that doesn't make sense
<gustav__> That's how I understand what you explained above.
<flux> apparently there are "36 Unified Reservation Stations" in nehalem architecture, not sure if it's the same as execution units
<pippijn> it seems my explanation was bad
beginner42 has joined #ocaml
<beginner42> how can i include a module inside a signature?
<flux> gustav__, apparently there are much fewer execution units than I thought. bu t look at here, it's relevant: http://www.tomshardware.com/reviews/Intel-i7-nehalem-cpu,2041-5.html
<flux> gustav__, it even has a picture :)
<gustav__> YAY
<gustav__> o_o
<gustav__> What's a port?
<Qrntz> beginner42, «include module type of M» if you mean including another module's signature
<gustav__> Do I put my USB in it?
<flux> gustav__, I think you're worrying too much about CPU architecture :)
<gustav__> It's interesting. I hardly know anything.
<beginner42> Qrntz: i have read this at stackoverflow but in my case i get Unbound module M
<gustav__> I wanna SEE an i7 execute. :) Running.
<gustav__> :)
<gustav__> In profile.
<pippijn> you should study computer science if you're interested in this stuff
<gustav__> I wonder if they do that at Intel labs.
<gustav__> I have, some.
<pippijn> at intel labs, they probably simulate execution
<gustav__> But I don't live up to the requirements. You need "points" to get money etc.
<gustav__> Ooo.
<gustav__> It's a game. I don't like games.
<gustav__> I suck at Chess.
<gustav__> And HoN.
<Qrntz> beginner42, does your implementation (.ml) compile if you don't compile the interface (.mli)?
<Qrntz> also I'm assuming you substituted «M» with your desired module's name
<flux> gustav__, maybe this is for you: http://www.nand2tetris.org/
<gustav__> I like this computer. I can run FAH, a virtual computer and play HoN at the same time and HoN works flawlessly... it's crazy.
<gustav__> flux: :O
<gustav__> I have Lego Mindstorms actually. Not the same thing, I know.
<flux> well, nans2legominstorm then :)
<flux> I actually have a lego mindstorm as well, got it from my friends as a graduation gift
<flux> did a robot I could control from pc (with ocaml :)) but that's it :(
<gustav__> :)
<gustav__> I made a radar with mine.
<flux> it had a radar, yes :)
<gustav__> Not with OCaml but Java.
<gustav__> Nice. :)
Xizor has joined #ocaml
<beginner42> Qrntz: yes, if i remove the mli file it compiles. and yes
<gustav__> I have a lot of mind hurdles to get over before I can use it properly, I think.
<Qrntz> weird
<Qrntz> beginner42, what's the referenced module and how do you build?
<flux> gustav__, but I really suggest you going through a course/book something like that. even if you aren't able to design an i7 when you finish it, you should have a much better understanding how things go together.
<flux> beginner42, maybe it would help if you were able to put stuff you have online
<flux> github gist supports multiple files
<gustav__> flux: Yep. I try to look at all courses I can find, online.
<flux> gustav__, you don't need all, you need one good one :)
<gustav__> MIT OCW, Yale OYC, Harvard has some videos you watch from the beginning of the courses when the students aren't registered. :3
<gustav__> flux: Yeah, an optimized product. It's hard to know what that is, especially for me. I watch A LOT. Read as much as I can... well.
<gustav__> It's hard to keep up engagement all the time. If that's the correct word.
<flux> gustav__, also, keep in mind what they say about mathematics: it's not a spectator sport :)
<gustav__> Right.
<gustav__> I think it mostly is though. Like with OCaml... but yeah, not 100%. But it's hard to do math on the computer. Paper is so damn annoying and depressing.
<gustav__> I more believe in programming the brain with as much input as possible.
<gustav__> I let different sources compete. TV and lecture for instance. There's a lecture on TV.
<gustav__> Multicore. (Y)
<gustav__> That's how the world works.
mye has joined #ocaml
<gustav__> Nothing is 100% interesting.
<beginner42> Qrntz: my interface looks like that
<Qrntz> ah
<Qrntz> just «include S» should work then
<beginner42> Qrntz: inside the mli file or the ml file?
<Qrntz> .mli, right where you have «include module type…»
gnuvince has joined #ocaml
<Qrntz> «module type of» retrieves the signature of a module implementation, thought you'd want that
<beginner42> Qrntz: if module type of retrieves the signature, why then replacing it with include S?
<Qrntz> 16:43:31 < Qrntz> «module type of» retrieves the signature of a module implementation
<Qrntz> you need to include an interface you already have from what I see
<Qrntz> s/interface/signature/
<beginner42> do i have to write include S in the ml file as well?
<Qrntz> no, unless you have a module named S that matches the module type S and you want to include its implementation
<Qrntz> if the implementation of your Make functor lacks some fields required by the included module type S the compiler will tell you about that
jamii has joined #ocaml
jpdeplaix has quit [Ping timeout: 240 seconds]
<beginner42> Qrntz: the ml file contains the implementation of the functor as well as the module S
walter has joined #ocaml
<Qrntz> then yes, you probably want to «include S» in the functor's implementation as well
jpdeplaix has joined #ocaml
Neros_ has quit [Read error: Operation timed out]
<beginner42> but now i get this
<beginner42> The field `S' is required but not provided
fraggle_laptop has quit [Remote host closed the connection]
Kakadu has quit []
<Qrntz> that's weird, suggests a namespace clash of some kind
mfill has joined #ocaml
<beginner42> Qrntz: could it be that the functor takes (ST : Set.S) and the conflict comes from that S?
<Qrntz> I don't think so; unless you opened the Set module somewhere, of course
<gustav__> http://crosstalks.tv/talks/crosstalks/ Entrepreneurship.
<gustav__> Maybe not the right channel.
beginner42 has quit [Ping timeout: 268 seconds]
Neros_ has joined #ocaml
beginner42 has joined #ocaml
<beginner42> Qrtnz: sorry lost my internet connections
<Qrntz> 17:03:08 < beginner42> Qrntz: could it be that the functor takes (ST : Set.S) and the conflict comes from that S?
<Qrntz> 17:03:53 < Qrntz> I don't think so; unless you opened the Set module somewhere, of course
<beginner42> Qrntz: thanks, but as far as i see i dont open the Set module
<Qrntz> I have little clue then
hkBst has quit [Quit: Konversation terminated!]
<beginner42> Qrntz: thanks for your effort. If i find a solution i will post it
<Qrntz> you are welcome
thomasga has quit [Quit: Leaving.]
tac has joined #ocaml
larhat has quit [Quit: Leaving.]
mattrepl has joined #ocaml
mfill has quit [Quit: Lost terminal]
ftrvxmtrx has quit [Quit: Leaving]
Submarine_ has joined #ocaml
Submarine_ has quit [Changing host]
Submarine_ has joined #ocaml
Submarine_ has quit [Client Quit]
cago has left #ocaml []
andreypopp has quit [Quit: sleep]
avsm1 has quit [Quit: Leaving.]
avsm1 has joined #ocaml
ontologiae has quit [Ping timeout: 252 seconds]
ftrvxmtrx has joined #ocaml
lolcathost has quit [Ping timeout: 256 seconds]
djcoin has quit [Quit: WeeChat 0.3.9.1]
tane has joined #ocaml
lolcathost has joined #ocaml
lolcathost has quit [Changing host]
lolcathost has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
walter has quit [Quit: This computer has gone to sleep]
Fullma has joined #ocaml
sepp2k has quit [Ping timeout: 264 seconds]
sepp2k has joined #ocaml
avsm1 has quit [Quit: Leaving.]
pangoafk is now known as pango
avsm1 has joined #ocaml
Yoric has joined #ocaml
avsm1 has quit [Client Quit]
andreypopp has joined #ocaml
beckerb has quit [Quit: Konversation terminated!]
chambart has quit [Ping timeout: 268 seconds]
mfill has joined #ocaml
gnuvince has quit [Ping timeout: 255 seconds]
travisbrady has joined #ocaml
andreypopp has quit [Quit: sleep]
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
UncleVasya has quit [Read error: Connection reset by peer]
thelema has quit [Remote host closed the connection]
thelema has joined #ocaml
tac has quit [Ping timeout: 245 seconds]
chambart has joined #ocaml
tac-tics has joined #ocaml
lambdas has joined #ocaml
<pippijn> what is the most efficient non-array mapping from small integers to 'a?
mfill has quit [Quit: leaving]
<pippijn> let's put it this way
<pippijn> what is the most efficient persistent mapping from small integers to 'a?
thelema has quit [Ping timeout: 255 seconds]
milosn has joined #ocaml
beginner42 has quit [Quit: irc2go]
thelema has joined #ocaml
<pippijn> the fastest I know of so far is a radix tree on the integer's bits
<wieczyk> Could someone help me with circular-dependies? Ocamlbuild is throwing error about this for .mlpack, but I cannot see a problem.
<pippijn> for me, lookup is more important than insertion
<wieczyk> Why not array? Yes, it is not answer for your question but i am interested.
<pippijn> because of persistence
<pippijn> I want a persistent data structure
<wieczyk> You can hide mutable array behind some interface which makes whole stuff persistent
<pippijn> yeah.. but that is *too* expensive
<wieczyk> Yeah, without sharing.
<pippijn> lookup is more important than insertion, but insertion does happen
<pippijn> and copying large arrays (10000 elements) is not good
<wieczyk> Maybe you should check Haskell IntMap, they have designed map for integers
<pippijn> 20:36 < pippijn> the fastest I know of so far is a radix tree on the integer's bits
<pippijn> that's it
<wieczyk> maybe if you could read about algorithm there then maybe you could find more appropriate algorithm for you.
<pippijn> I understand the algorithm
<pippijn> I'm just asking here, because someone might know a better data structure, already
<pippijn> this one is from 1998, someone might have come up with something better by now
<wieczyk> Yes, I see, Okasaki.
<pippijn> yep
<wieczyk> Well, I do not know newer.
lolcathost is now known as CPoverCPP
emmanuelux has joined #ocaml
answer_42 has quit [Quit: WeeChat 0.3.9.1]
chambart has quit [Ping timeout: 246 seconds]
cdidd has quit [Read error: Connection reset by peer]
thelema has quit [Remote host closed the connection]
thelema has joined #ocaml
CPoverCPP has quit [Ping timeout: 246 seconds]
CPoverCPP has joined #ocaml
CPoverCPP has quit [Changing host]
CPoverCPP has joined #ocaml
CPoverCPP has quit [Ping timeout: 252 seconds]
hongboz has joined #ocaml
spaceships has joined #ocaml
spaceships has left #ocaml []
Snark has quit [Quit: Quitte]
lolcathost has joined #ocaml
andreypopp has joined #ocaml
ocp has quit [Read error: Operation timed out]
Ptival has quit [Quit: leaving]
Ptival has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
Ptival has quit [Client Quit]
mindbender1 has joined #ocaml
Ptival has joined #ocaml
gnuvince has joined #ocaml
milosn has quit [Ping timeout: 264 seconds]
xavierm02 has quit [Quit: Leaving]
gnuvince has quit [Ping timeout: 260 seconds]
mattrepl has quit [Quit: mattrepl]
Submarine has quit [Remote host closed the connection]
tane has quit [Quit: Verlassend]
milosn has joined #ocaml
tac has joined #ocaml
avsm1 has joined #ocaml
tac-tics has quit [Ping timeout: 245 seconds]
Anarchos has joined #ocaml
leoncamel has quit [Ping timeout: 252 seconds]
myx has quit [Remote host closed the connection]
myx has joined #ocaml
chambart has joined #ocaml
avsm1 has quit [Ping timeout: 248 seconds]
ikaros has quit [Quit: Ex-Chat]
Cyanure has quit [Quit: Quitte]
Yoric has quit [Ping timeout: 246 seconds]
lolcathost has quit [*.net *.split]
thelema has quit [*.net *.split]
ftrvxmtrx has quit [*.net *.split]
jamii has quit [*.net *.split]
cross has quit [*.net *.split]
snarkyboojum has quit [*.net *.split]
xaimus has quit [*.net *.split]
cross has joined #ocaml
lolcathost has joined #ocaml
lolcathost has quit [Changing host]
lolcathost has joined #ocaml
thelema has joined #ocaml
ftrvxmtrx has joined #ocaml
jamii has joined #ocaml
snarkyboojum has joined #ocaml
lolcathost has quit [Client Quit]
ttm has joined #ocaml
wormphle1m has joined #ocaml
andreypopp has quit [Quit: sleep]
xaimus has joined #ocaml
andreypopp has joined #ocaml
wormphlegm has quit [*.net *.split]
The_third_man has quit [*.net *.split]
gnuvince has joined #ocaml
Oejet has joined #ocaml
sepp2k has quit [Remote host closed the connection]
mjonsson has joined #ocaml
lolcathost has joined #ocaml
andreypopp has quit [Quit: sleep]
mindbender1 has quit [Ping timeout: 265 seconds]
notdan has quit [Ping timeout: 248 seconds]
jamii has quit [Ping timeout: 255 seconds]
notdan has joined #ocaml
notdan has quit [Changing host]
notdan has joined #ocaml
tac has quit [Ping timeout: 245 seconds]
travisbrady has quit [Quit: travisbrady]
gnuvince has quit [Ping timeout: 276 seconds]
mindbender1 has joined #ocaml
Oejet has left #ocaml []
Xizor has quit [Remote host closed the connection]
fraggle_ has quit [Ping timeout: 245 seconds]
chambart has quit [Ping timeout: 246 seconds]
walter|r has joined #ocaml
fraggle_ has joined #ocaml
Anarchos has quit [Quit: dodo]
smondet has quit [Ping timeout: 245 seconds]
milosn has quit [Ping timeout: 240 seconds]
gnuvince has joined #ocaml
mye has quit [Quit: mye]
eni has joined #ocaml
travisbrady has joined #ocaml
travisbrady has quit [Ping timeout: 265 seconds]
rwmjones has quit [Read error: Operation timed out]