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/
xavierm02 has quit [Quit: Leaving]
Ptival_ has joined #ocaml
Ptival_ has quit [Client Quit]
dskippy has joined #ocaml
Ptival has quit [Quit: leaving]
Ptival has joined #ocaml
hongboz has joined #ocaml
madroach has quit [Ping timeout: 244 seconds]
madroach has joined #ocaml
Progster has joined #ocaml
sepp2k1 has quit [Read error: Connection reset by peer]
Drakken has quit [Remote host closed the connection]
hongboz has quit [Ping timeout: 246 seconds]
cdidd has quit [Remote host closed the connection]
Progster has quit [Ping timeout: 265 seconds]
lolcathost has quit [Ping timeout: 265 seconds]
Yoric has quit [Quit: Instantbird 1.3a1pre -- http://www.instantbird.com]
Yoric has joined #ocaml
justdit has joined #ocaml
chambart has quit [Ping timeout: 246 seconds]
astertronistic has joined #ocaml
wagle_ is now known as wagle
TDJACR has quit [Ping timeout: 276 seconds]
mjonsson has quit [Ping timeout: 240 seconds]
lolcathost has joined #ocaml
ankit9 has joined #ocaml
ankit9 has quit [Ping timeout: 252 seconds]
andreypopp has joined #ocaml
andreypopp has quit [Quit: sleep]
larhat has quit [Quit: Leaving.]
dskippy has quit [Quit: Leaving.]
lolcathost has quit [Ping timeout: 260 seconds]
lolcathost has joined #ocaml
lolcathost has quit [Client Quit]
andreypopp has joined #ocaml
larhat has joined #ocaml
pango is now known as pangoafk
Cyanure has joined #ocaml
justdit has quit [Ping timeout: 252 seconds]
fusillia has joined #ocaml
andreypopp has quit [Quit: sleep]
ftrvxmtrx has quit [Quit: Leaving]
lolcathost has joined #ocaml
hkBst has joined #ocaml
ankit9 has joined #ocaml
justdit has joined #ocaml
thomasga has joined #ocaml
djcoin has joined #ocaml
Cyanure has quit [Ping timeout: 260 seconds]
BiDOrD has joined #ocaml
BiDOrD_ has quit [Read error: Connection reset by peer]
cago1 has joined #ocaml
andreypopp has joined #ocaml
Cyanure has joined #ocaml
mcclurmc_away is now known as mcclurmc
fusillia has quit [Read error: Connection reset by peer]
Neros has quit [Ping timeout: 265 seconds]
thomasga has quit [Read error: No route to host]
thomasga has joined #ocaml
ontologiae has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
Kakadu has joined #ocaml
testcocoon has joined #ocaml
Neros has joined #ocaml
Neros has quit [Ping timeout: 260 seconds]
avsm has joined #ocaml
gustav__ has joined #ocaml
_andre has joined #ocaml
<gustav__> Hi, is there an _easy_ way to replace a string of the form "$xyz" from another string "hello $xyz, welcome!" and substitute with "joe?" WITHOUT using Str? I can't get it to work.
<companion_cube> why would you want not to use Str? ôO
<gustav__> I don't like the name but I could try to load it...
<flux> ..you're not using Str because of its name?-)
<flux> but actually, Str isn't that great a library if you ever intend to use threads
chambart has joined #ocaml
<gustav__> No. I had that feeling.
<flux> I think there are these options: 1) use Str 2) use some other templating library for ocaml 3) use pcre 4) do it manually :)
<gustav__> Hmm.
<gustav__> Maybe if I can convert the string to a list.
<gustav__> I don't get why all languages make such a difference between the two.
<flux> Haskell doesn't
<gustav__> Except maybe C.
<gustav__> Okay.
<flux> but I think its String (a list of characters) doesn't perform that well in real-life, so people use Text nowadays
<gustav__> I haven't tried Haskell.
<flux> it's just not very efficient to store strings as linked lists: very small items, very long lists
<gustav__> Yeah. Usually that's the problem with these neat...constructions. Poorly optimized.
<gustav__> True.
<gustav__> But they don't have to be stored like that, just because the language is like that.
<flux> but the other thing is that ocaml doesn't do run-time type information
<flux> so it would probably result in a wart when dealing with polymorphic values
<Kakadu> gustav__: I can always write an OCaml module which will incapsulate string and store it as you want :)
<flux> but that being said, there is a regular expression pattern matching language extension for ocaml
<Kakadu> s/I/you/
Yoric has quit [Ping timeout: 246 seconds]
<flux> :-)
* Kakadu aslways make stupid mistakes
<gustav__> You do that. ;-)
<flux> wish there were a bunch of people doing that
<Kakadu> one more: always*
<gustav__> Yeah.
<flux> "I have this problem when doing X" "no worries, I'll write it for you"
<gustav__> People just doing what you want.
<gustav__> erhmerhgerd
<flux> exactly!
<flux> actually I've thought about something that would be integrated into an editor
<gustav__> Aren't those... Indian... people? *ducks*
<flux> you'd write (* sort entries *) val sort : ('a -> 'a -> int) -> 'a list -> 'a list
<flux> mark the region
<flux> hit the magic button
<flux> and people on the internet would fill in the code
<gustav__> Yeah.
<gustav__> xD
<gustav__> Yeah.
<gustav__> Like distcc.
<gustav__> Ehm.
<flux> well, not quite, but there is some similarity
<flux> I think the amazon mechanical turk for coders could work well with this :)
<gustav__> The what?
<gustav__> I really should get back to my problem.
<gustav__> Oh.
<flux> one could repackage that as a service and sell it to coders and companies :)
<gustav__> Yeah.
<gustav__> It's just to formalize things, I guess. Like that TCP packet pigeon.
<gustav__> In Sweden we have the Arbetsförmedling. And people sure need jobs.
<gustav__> Uhm.
thomasga has quit [Read error: Connection reset by peer]
thomasga has joined #ocaml
<gustav__> But, then... how do you verify the function? You'd need a looot of managers.
<gustav__> It seems when you want to verify a function you have to write it, every time. -.-"
<gustav__> Maybe these are proofs I'm talking about, I'm not very good with that. xD
<gustav__> I think strings always make me go back to C.
<Kakadu> What there is in C what doesn't exists in OCaml?
<gustav__> Speed, I think.
<Kakadu> AFAIK, OCaml strings internally looks like exactly like C ones
<gustav__> I think C code feels more robust too, I give you it's hard to define that "feeling."
<gustav__> Well, speed isn't that important for this project.
<flux> I'm surprised you feel that way regarding robustness
<gustav__> It should just work now.
<gustav__> Yes, well, OCaml is robust in other ways. It's very easy to write.
<flux> usually when I write ocaml I can feel relatively confident that I've handled all corner causes
<gustav__> C bites you every time. So robust in that way...
<gustav__> Hmm. Except exceptions? :)
<flux> the thing about C bites is that you might not even know it has happened
<flux> gustav__, "relatively" :)
<gustav__> Yeah, that's true. But it usually feels fine, for me at least, because the OS will object if things way to haywire.
<gustav__> I've done a loot of C code and I know most of what can go wrong. At least with memory. The signals. And such.
<companion_cube> with ocaml I feel like the type system prevents most bugs from compiling
<Kakadu> `Ocaml programs will work as expected if it compiles` (c)
<gustav__> Hmhm.
<gustav__> OCaml is very forgiving when I want to code C-style. That's nice.
andreypopp has quit [Quit: sleep]
<gustav__> And the documentation even admits recursive functions aren't that great.
lolcathost has quit [Ping timeout: 240 seconds]
<gustav__> AND exceptions don't really work, well, as expected, but they've crept up on me at least...
<gustav__> Not sure what it should do. Just forcing me to write try...x isn't that nice either...
lolcathost has joined #ocaml
<Kakadu> gustav__: stdlib always use exceptions
andreypopp has joined #ocaml
<Kakadu> there r some enhancements of stdlib
<gustav__> Why is there Str AND String? Hmmmm...
<flux> String is required by the compiler, Str is not
<gustav__> OCaml doesn't really seem to care about scope, in some weird way.
<flux> really?
<Kakadu> wut?
<gustav__> Sometimes I can just forget about scope and it works the same way.
<flux> maybe you have a different view of a scope than ocaml :)
<flux> for example, the amount of whitespace doesn't affect it ;-)
<gustav__> Yeah. Maybe.
<gustav__> No, I don't think about that. That much at least.
<gustav__> You play with Python one time and you're damaged for life.
<gustav__> Some errors are damn hard to understand.
<gustav__> Can I give you an example?
<flux> sure
<companion_cube> ocaml's scoping is perfectly fine...
<gustav__> :D
<gustav__> Line 11 is the last line in the example.
caligula__ has joined #ocaml
<gustav__> There's a new line above the first line after --begin in the pastebin I did.
zzz_` has joined #ocaml
caligula_ has quit [Read error: Connection reset by peer]
zzz_ has quit [Remote host closed the connection]
Haseo has quit [Ping timeout: 265 seconds]
Haseo has joined #ocaml
<flux> gustav__, have you looked what the type of Printf.printf is?
<gustav__> No. But. I want process to return a string. I thought it did.
<gustav__> But I will.
<flux> and it does
<flux> but the problem is that string variables are not format strings
<gustav__> Oh.
<flux> format strings are staticalyl checked at compile time
<gustav__> Aha.
<flux> so you can see it cannot work with dynamic strings
<flux> you can do this: printf "%s" (process "hello")
<gustav__> I shouldn't send that stuff to printf anyway.
<gustav__> Yeah.
<gustav__> Right. Now the "" gets an oob exception... hmm.
<flux> also, there's another problem in your process-function. the r string is empty. and its change cannot be changed. better use String.create (String.length x) instead
<flux> and there's a third problem
<gustav__> I tried that, but I don't get a string back. I get some function.
<flux> the for-loop goes one character too far
<flux> you probably used String.make instead?
<flux> String.make makes an n-length strings filled with a character
<flux> String.create is more like.. C malloc :)
<gustav__> Ah. D'oh.
<flux> if you get a function when expecting a value, it almost certainly means you have given too few arguments
<flux> (due to partial evaluation)
<gustav__> Hmm.
<gustav__> I haven't seen anyone else use partial evaluation before. xD
<gustav__> OH. Now it works. Awesome.
<gustav__> Hmm.
<gustav__> I mean, it worked all the time. Maybe I was talking about my brain. :-P
lolcathost has quit [Quit: leaving]
Yoric has joined #ocaml
<gustav__> Some ask page suggested to use Buffer instead of String for these kinds of things, is that correct you think? It sounds snappier.
<gustav__> It has nice functions, too. add_char, for instance.
<flux> I don't know about snappy
<flux> but it's more suitable for buildling strings
<gustav__> Ah.
<gustav__> I want that.
<gustav__> Yeah. Those error messages are helping me.
<gustav__> C sends you out in space.
<gustav__> "Uncalibrated molecule at 0x3f4f43"
<gustav__> Damn physisists.
<gustav__> Can't even spell it.
lolcathost has joined #ocaml
<pippijn> %%% lexing with re2ml took 0.538540s
<pippijn> %%% lexing with ocamllex took 1.049168s
<pippijn> %%% lexing with flex (C++) took 0.421299s
chambart has quit [Ping timeout: 246 seconds]
Neros has joined #ocaml
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 246 seconds]
beckerb has joined #ocaml
sepp2k has joined #ocaml
avsm has quit [Quit: Leaving.]
<Kakadu> pippijn: So, You've succeded to find a test where your lexer is faster?
<Kakadu> :)
Neros has quit [Ping timeout: 260 seconds]
<pippijn> Kakadu: it's always faster
<Kakadu> pippijn: It was trolling
<djcoin> :)
cdidd has joined #ocaml
<pippijn> if it knows it's operating on string buffers, it can be faster: %%% lexing with re2ml took 0.406631s
Neros has joined #ocaml
xavierm02 has joined #ocaml
<pippijn> Kakadu: there is a perl module that parses JSON
<pippijn> it parses this 43MB file in 1.6 seconds and also builds a perl data structure out of it
<pippijn> my JSON parser takes 0.9 seconds just for lexing and parsing, not even building a data structure
<pippijn> not even parsing strings
<pippijn> sad..
<Kakadu> TT
<pippijn> %%% lexing with re2ml took 2.663109s
<pippijn> this is with parsing strings and integers
avsm has joined #ocaml
<pippijn> => ocaml is a lot slower than perl
<pippijn> or well.. *my* ocaml code is slow
<flux> I've found a similar performance mismatch when doing log analysis
<flux> perl just is damn fast for practical extraction and reporting :)
<pippijn> this is without parsing strings, just returning them in tokens: %%% lexing with re2ml took 0.820383s
<pippijn> so my string "unescape" is slow
<pippijn> I already knew that, though
<pippijn> unescape builds a list, first
<flux> I once tried to compete with mutt on reading&threading a mailbox. failed :(
<flux> but mutt is pretty fast
pcjoby has joined #ocaml
ppseafield has joined #ocaml
avsm has quit [Ping timeout: 268 seconds]
<pippijn> slightly improved unescape: %%% lexing with re2ml took 2.062630s
<pippijn> still super slow
<pippijn> one copy less: %%% lexing with re2ml took 1.973362s
answer_42 has joined #ocaml
ocp has joined #ocaml
<pippijn> integers instead of a variant: %%% lexing with re2ml took 1.917814s
ftrvxmtrx has joined #ocaml
<pippijn> not worth it
<flux> how about adding multi process support?-)
<flux> you would split the data in half, lex them separately.. and then be extra smart about the boundary :)
<djcoin> I guess your parser already works with streams ?
<pippijn> djcoin: yes
Kakadu has quit [Remote host closed the connection]
Kakadu has joined #ocaml
sgnb has joined #ocaml
avsm has joined #ocaml
avsm has quit [Ping timeout: 245 seconds]
<pippijn> %%% lexing with re2ml took 1.183573s
<pippijn> flux: not multi-process, but I moved unescape into the lexer itself
ankit9 has quit [Quit: Leaving]
avsm has joined #ocaml
justdit has quit [Ping timeout: 248 seconds]
avsm has quit [Quit: Leaving.]
mjonsson has joined #ocaml
avsm has joined #ocaml
gnuvince has quit [Ping timeout: 252 seconds]
Neros has quit [Read error: Connection reset by peer]
Neros has joined #ocaml
avsm has quit [Quit: Leaving.]
justdit has joined #ocaml
BiDOrD_ has quit [Ping timeout: 260 seconds]
avsm has joined #ocaml
smondet has joined #ocaml
mjonsson has quit [Ping timeout: 240 seconds]
gnuvince has joined #ocaml
Neros has quit [Read error: Connection reset by peer]
BiDOrD has joined #ocaml
lolcathost has quit [Ping timeout: 256 seconds]
Neros has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
gnuvince has quit [Ping timeout: 265 seconds]
answer_42 has quit [Ping timeout: 276 seconds]
answer_42 has joined #ocaml
andreypopp has quit [Quit: sleep]
travisbrady has joined #ocaml
<thelema> pippijn: there's a time difference between using integers and using a variant type?
<pippijn> thelema: type t = NoEscape | Escape | HexEscape of int
<pippijn> thelema: vs. -1 | -2 | +n
<thelema> pippijn: ah, yes. a tiny difference; the N would be boxed
<pippijn> yes
<thelema> I once wrote code that re-implemented an option type unboxed, using NULL for None. I don't recall it having much of a speed difference
<pippijn> thelema: I did that in one program and it helped a *lot*
<thelema> I guess it depends on your app
<pippijn> yes
gnuvince has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
Kakadu has joined #ocaml
jamii has joined #ocaml
Neros has quit [Quit: No Ping reply in 180 seconds.]
Neros has joined #ocaml
hkBst has quit [Quit: Konversation terminated!]
BiDOrD has quit [Read error: Connection reset by peer]
BiDOrD_ has joined #ocaml
<gustav__> Any idea what's wrong with this? http://pastebin.com/dx599d9g
<hcarty> gustav__: I'm guessing that the ',' on line 6 shouldn't be there
<gustav__> Right...
<gustav__> Hmm.
<gustav__> It works. :)
eikke has joined #ocaml
Cyanure has quit [Remote host closed the connection]
cago1 has left #ocaml []
larhat has quit [Quit: Leaving.]
eikke has quit [Ping timeout: 256 seconds]
Yoric has quit [Ping timeout: 252 seconds]
answer_42 has quit [Ping timeout: 276 seconds]
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
<gustav__> http://pastebin.com/D1HWVqc9 Why isn't this okay? Why is there a syntax error on line 13? :(
<Pantoufle> gustav__: try to put the (); at the end of line 13
<gustav__> Negative.
<Qrntz> gustav__, variable names start with a lowercase letter
<gustav__> There is something "up" with the "and."
<Qrntz> and that too, in fact
<Qrntz> use &&
<gustav__> Qrntz: Yes?
<Qrntz> «and» is reserved to definitions
<gustav__> Ah. Naow.
<gustav__> I see.
<Qrntz> && and & are logical AND operators, but the latter is deprecated
<Qrntz> ach, never mind my statement about variable names, I parsed your code the wrong way
<gustav__> So I can't use "not" then, either?
<gustav__> Hum...
<gustav__> Or can I?
Neros has quit [Ping timeout: 260 seconds]
answer_42 has joined #ocaml
<gustav__> Yay. Progress...
<gustav__> WEowoeowow!
<Qrntz> gustav__, you can, «not» is actually an unary boolean operator
<gustav__> Can I put a 'type' in a let x = z? I won't be using it anywhere else. Well, like in the script.
<gustav__> Do I have to create a module for that?
<gustav__> The /thing/ isn't exactly agreeing with me.
iago has joined #ocaml
<Qrntz> gustav__, so you want a local type?
<gustav__> Yes.
sgnb has quit [Ping timeout: 246 seconds]
<_habnabit> type x = z
<gustav__> And also, why can't I have multiple statements in an if statement? o_o
<gustav__> _habnabit: It complains about that.
<_habnabit> gustav__, just use parentheses or begin/end if you want to execute multiple imperative statements in an if
<_habnabit> gustav__, 'it complains' also isn't an error message
<gustav__> _habnabit: "Syntax error."
<_habnabit> gustav__, when you type what, exactly?
<gustav__> let process x = \n type scanning = InA | InB
<gustav__> SE is the second line.
<_habnabit> you can just move that type out to the module scope
<gustav__> But then it isn't local. :/
<gustav__> I'm not in a module scope.
<gustav__> I think.
<gustav__> Just a plain old file.
<Qrntz> every file is a module
<_habnabit> yes, files are modules
<gustav__> Okay.
tac has joined #ocaml
<_habnabit> type scanning = InA | InB let process x = ...
<gustav__> Yes, that's what it is now.
iago has quit [Quit: Leaving]
<gustav__> I guess it doesn't matter.
<_habnabit> you don't have to include that type in your .mli file, so nobody will know about it
<thelema> no local types, they have to be declared as a phrase
<thelema> private types are all you get.
<gustav__> What about the suspicious types...?
sgnb has joined #ocaml
<thelema> suspicious types?
<thelema> I see you parsing an input string x, which is pairs of alphabet strings (variable name) followed by arbitrary data (rest), separated by $
<thelema> if I were doing this, I might use mutually recursive functions:
<thelema> let process x = let len = String.length x in let r = Buffer.create 100 in let rec rest i = if i < len then match x.[i] with '$' -> var (i+1) | c -> Buffer.add_char r c; rest (i+1) and var i = if i < len then match x.[i] with a..zA..Z -> var (i+1) | _ -> rest i in rest 0; Buffer.contents r
<thelema> Without formatting, it looks pretty terrible.
<gustav__> I want to use something neat like a :: rest... if a = "$" ...something like that. But it's hard to do with substrings.
<gustav__> I can't even explain it...
<gustav__> I guess there are no operators for chars, so.
<gustav__> My code is an iterative version of a recursive function, let's say...
<thelema> what operator do you want for chars?
<thelema> One option is to use String.explode (from batteries) to turn your string into a char list
<thelema> then you can use nice pattern matching on lists for parsing
<gustav__> Concatenation.
<gustav__> Yes, probably.
<thelema> another option is to return a list of slices instead of building a buffer
<gustav__> True.
<gustav__> But how do you slice? Str.regexp-things?
avsm has quit [Quit: Leaving.]
<gustav__> What does the "and" do in your code? You're allowed to use it but not me? :C
ulfdoz has joined #ocaml
<thelema> just a (int * int) list
<thelema> gustav__: :) 'and' is used for defining mutually recursive values. let a = ... b ... and b = ... a ... in ...
<gustav__> Mutually recursive...?
<thelema> 'rest' calls 'var' and 'var' calls 'rest'
<thelema> and they both call themselves
<gustav__> I need a chair.
<thelema> :)
<gustav__> OH. rec is a special name. Entity.
mfp has quit [Read error: Connection reset by peer]
Neros has joined #ocaml
<gustav__> I think I get it now.
<gustav__> But it's not more elegant than my stuff.
<thelema> maybe simplest is to just use batteries string functions: let process x = String.nsplit ~by:"$" x |> List.map remove_variable_name_at_head
<gustav__> I bet mine is faster, too.
<thelema> sadly, batteries doesn't even have a search for a class of characters
ulfdoz has quit [Ping timeout: 240 seconds]
<thelema> gustav__: actually, they're probably about the same runtime.
<gustav__> You can pipe, too? O_O
<thelema> and 'rec' is a keyword
<thelema> batteries has a |> function
Cyanure has joined #ocaml
ulfdoz has joined #ocaml
<gustav__> Aha.
<thelema> let (|>) x f = f x
<gustav__> Batteries won't load with Apache.
<thelema> apache?
<gustav__> Yes. mod_netcgi.
<gustav__> Or what it's called.
<thelema> what's the problem?
<gustav__> Or maybe the script won't compile. Wait.
<thelema> It's pure ocaml...
<gustav__> I should be able to do open BatFile, right?
<thelema> yes, you should be able to do open BatFile
<thelema> if you use the correct compile invocation
<gustav__> I bet it works now just because...
<thelema> :)
gnuvince has quit [Ping timeout: 256 seconds]
<gustav__> Unbound module BatFile, I do this: -package batteries with ocamlfind ocamlc. Should that work?
<gustav__> All the Batteries files are there, in the correct location, I think.
<thelema> ocamlfind ocamlc -package batteries -linkpkg foo.ml -o foo
astertronistic has quit [Ping timeout: 246 seconds]
<gustav__> Nope.
<thelema> can you paste your whole command?
<gustav__> perl -le "system('ocamlfind ocamlc -package netcgi_apache -package batteries -linkpkg -package netcamlbox -package postgresql -thread -c a.ml && ocamlfind ocamlc -package postgresql -package batteries -linkpkg -package netcamlbox -thread -a -o a.cma a.cmo; date'),sleep(1) while 1"
<gustav__> Hmm.
<thelema> ok, don't need -linkpkg on the first command
<thelema> because of -c
<thelema> hmm, maybe not even on second command...
<thelema> because compiling to .cma
<gustav__> Postgres works fine.
<thelema> yes, so probably not that... hmmm
<thelema> where's your META file for batteries installed to?
<gustav__> /usr/lib/ocaml/batteries/META
<hcarty> gustav__: What does 'ocamlfind query batteries' say?
<gustav__> /usr/lib/ocaml/batteries
<thelema> that's all very good.
<gustav__> I'm using standard Ubuntu packages so this stuff should work, I think.
<thelema> gustav__: unfortunately, only a minority of the ocaml community uses ubuntu packages
<gustav__> I see.
<gustav__> What do people normally use?
<gustav__> Or majorly?
<thelema> I agree it should work.
<thelema> There's three ocaml package managers: odb, godi and opam
<gustav__> Oh, right...
<thelema> godi has been around forever, but has some problems. odb is very simple, and opam is the new hotness
<gustav__> I don't like having package managers outside my system package manager. It tends to clutter the filesystem / losing control.
<Qrntz> it's not true that people generally don't use distro-specific packages, though — Gentoo ones are excellent
ulfdoz has quit [Ping timeout: 252 seconds]
mfp has joined #ocaml
<gustav__> I've never tried Gentoo. Once, maybe.
ocp has quit [Ping timeout: 248 seconds]
<Qrntz> well, I'm not advocating trying it just for having excellent OCaml packages, that'd be overkill
gnuvince has joined #ocaml
<hcarty> gustav__: Does a minimal example with Batteries work?
<gustav__> Depends what you mean by minimal - open Batteries won't work.
<thelema> gustav__: can you try compiling the example at https://github.com/ocaml-batteries-team/batteries-included/wiki/Getting-started
<thelema> using the command right after the source?
<gustav__> That works. o_O
<thelema> gustav__: very odd..
<thelema> multiple ocaml installations?
mfp has quit [Read error: Connection reset by peer]
<gustav__> No idea.
<thelema> have you ever installed ocaml or any libraries except through ubuntu packages?
<gustav__> No.
<thelema> ok, then probably not.
<gustav__> There's only one {ocaml,ocamlfind.}
<gustav__> On the system.
<thelema> good.
<thelema> why are you recompiling your library every second?
<gustav__> I have to listen to some Snoop Dogg, this stuff pisses me off.
<thelema> I look at the perl invocation, and it does a full recompile every second.
<thelema> probably not the problem...
<gustav__> thelema: Well, I usually type in the compile stuff after I edit my sources, but that's annoying.
<thelema> ok, I assume you won't leave that running in production...
<gustav__> There is no production for this. And no, not on the production machine at least, I guess.
<thelema> could you try just running the first command by itself
<thelema> without the perl wrapper?
avsm has joined #ocaml
<gustav__> Eh.
<gustav__> Right. I didn't restart the wrapper. >_<
<gustav__> There we go.
* gustav__ hears *facedesks* from a distance.
<gustav__> :D
<thelema> yes, very loud
<gustav__> xD
<gustav__> Can even be heard thru void space.
<gustav__> It complains about match not being exhaustive for a string match. But how can I be exhaustive? There is an infinite amount of possible matches...?
<gustav__> Hmm.
<gustav__> I must not be getting it.
<thelema> use "| _ -> " as default case
<Qrntz> add a catch-all
<thelema> or "| s -> " if you care what the string is
<gustav__> Right.
<gustav__> I wonder if something is, somewhere, trying to fulfill the wishes of this exhaustion.
<gustav__> Damnit. That wouldn't compile.
<gustav__> Ugh.
<gustav__> Another warning I don't understand...
mfp has joined #ocaml
<hcarty> gustav__: List.map returns a map. You probably want List.iter if you are looping through purely for output (side-effects).
<hcarty> s/returns a map/returns a list/
<hcarty> gustav__: You have a
<hcarty> ;
thomasga has quit [Quit: Leaving.]
<hcarty> OCaml expects an expression that evaluates to unit on the left of ';'
<gustav__> Tooooo bad. :>
<xavierm02> you have to use
<xavierm02> ignore( yourexpression)
<xavierm02> i think
<xavierm02> they showed me something like that yesterday
<gustav__> let a = List.map ... in
<gustav__> But then it complains I don't use the result.
<xavierm02> that's the point of ignore
sepp2k1 has joined #ocaml
<gustav__> What am I supposed to do with it? :C
<xavierm02> ah
<xavierm02> you mean it tells you you don't use the variable?
<gustav__> If I remove the ; there's a syntax error.
<gustav__> Yes.
andreypopp has joined #ocaml
sepp2k has quit [Ping timeout: 240 seconds]
CoverSlide has left #ocaml []
<_habnabit> gustav__, in this case, you use List.iter instead of List.map
<gustav__> Alright.
<hcarty> gustav__: List.iter
<gustav__> That works. Thanks.
<gustav__> I'm pretty off target here... I was going to do other stuff... ugh. I should've never switched from PHP. :(
<gustav__> But if I never switch I'll never switch.
<_habnabit> switching from PHP is always a good idea
<Ptival> this ^
<gustav__> Yeah.
<gustav__> Except it produces results.
<_habnabit> so does malbolge
<_habnabit> but you don't see me recommending that
<gustav__> o_o
<gustav__> :D
<gustav__> The plague?
<gustav__> Oh hell no, malbolge doesn't produce results.
<_habnabit> with trained and dedicated programmers, it sure does
<gustav__> That's like brainf*ck.
<gustav__> ...
<gustav__> " designed to be impossible to write useful programs in. However, weaknesses in this design have been" xD
<gustav__> Damn hackers.
<gustav__> Computers are pretty useless anyway.
<gustav__> Damn computers.
<gustav__> What's the preferred "pattern" for creating big applications in O'Caml?
<gustav__> Is there any?
mfp has quit [Read error: Connection reset by peer]
<gustav__> Maintainability and all of that.
<gustav__> Does O'Caml have AOT-compilation?
milosn has quit [Read error: Connection reset by peer]
<adrien> OCaml doesn't do JIT
<adrien> it compiles then runs
milosn has joined #ocaml
<gustav__> It drops some bytecode files but not native. Right?
deavid has quit [Quit: No Ping reply in 180 seconds.]
deavid has joined #ocaml
<thelema> gustav__: ocamlc compiles to bytecode, ocamlopt compiles to native code
<gustav__> Aha.
<gustav__> I wonder how that would work with netcgi_apache... probably not at all...
<adrien> look at ocamlnet
<gustav__> What I want, I think, for the least hassle, would be a .cma with native code in it. But that's something for Amazon Turk, I guess.
<gustav__> Performance isn't that important now, anyway...
<thizanne> gustav__: you can compile to native machine code with ocamlopt
<gustav__> Thx.
<gustav__> What's the difference between a.m and a#m?
<thelema> gustav__: a.m is record field, a#m is method call
avsm has quit [Quit: Leaving.]
mfp has joined #ocaml
pangoafk is now known as pango
mcclurmc is now known as mcclurmc_away
Tobu has quit [Remote host closed the connection]
<gustav__> Do any of you know how Facebook APIs work? I'll before go hunting in their docs.
<gustav__> s/ll/ll ask/
<gustav__> I wonder if there is some way of making Facebook push data instead of having to poll for it.
<gustav__> The olde pull-and-push problem. When do I pull, just push when data changed, problem.
ontologiae has quit [Ping timeout: 240 seconds]
<gustav__> If anyone is interested I can post the URL to the documentation.
<gustav__> Damn it's cold. I think it's snowing.
justdit has quit [Ping timeout: 255 seconds]
Kakadu has quit [Remote host closed the connection]
<xavierm02> What are you trying to do anyway?
srcerer has quit [Quit: ChatZilla 0.9.89 [Firefox 15.0.1/20120905151427]]
djcoin has quit [Quit: WeeChat 0.3.9]
tane has joined #ocaml
_andre has quit [Quit: leaving]
deavid has quit [Quit: No Ping reply in 180 seconds.]
deavid has joined #ocaml
Submarine has quit [Quit: Leaving]
pango has quit [Remote host closed the connection]
pango has joined #ocaml
<gustav__> xavierm02: Some kind of "BI" and I'm just looking for a data source.
<gustav__> Guess I can use anything.
<gustav__> Facebook doesn't let you subscribe to the news feed. So that's a drag.
sepp2k1 has quit [Remote host closed the connection]
<gustav__> I don't have a lot of activity on my timeline. Nothing interesting anyway.
<gustav__> Now I sound like a lonely person. :O
<thelema> :) You're welcome to hack on batteries - it needs some simple string search functions
<thelema> (as I (re-)discovered earlier)
<gustav__> Butttttt. I wanna try BI.
<gustav__> It's so fancy.
<gustav__> It needs to change names to... IMHO. BatFiles sound like BatMan...
<thelema> bayesian inference?
<gustav__> What's that?
<gustav__> Damn. You're faster than me. :O
<xavierm02> he's trying to guess what you mean by BI
<xavierm02> i think
<K_F> business intelligence?
<thelema> yes, I had this page open...
<gustav__> Yes, something like that.
<gustav__> Well, it's simple. Just do a graph of some data in... well with t as x.
<gustav__> Like updates/t.
srcerer has joined #ocaml
<gustav__> I've done these things for IRC waaay waay long time ago. Graphs and predictions who's writing most lines per day and such. It's fun. :)
<gustav__> gnuplot is great for that.
<thelema> if you're interested in plotting, maybe you can play with archimedes some... http://archimedes.forge.ocamlcore.org/
<gustav__> OH.
<gustav__> HM...
<gustav__> Business Intelligence and Bayseian inference are almost the same thing, it seems, anyway. But I was referring to the former.
<gustav__> Idk.
<gustav__> No...well, in some abstract way, maybe...
<gustav__> thelema: gnuplot can adapt functions to data, or what you say, that's the most important.
<gustav__> So you can get like: It's 51 minutes left til gustav__ has written more than thelema in #ocaml.
<thelema> ? you mean fitting functions?
<gustav__> Yes, exactly.
<thelema> linear regression isn't particularly difficult.
<gustav__> I haven't tried it myself.
<gustav__> First I need some data.
<gustav__> Hmmmm.
<gustav__> Some RSS feed maybe.
lolcathost has joined #ocaml
<gustav__> Having a bunch of sensors at home would be cool.
<gustav__> Or in a tree down town.
<gustav__> :P
avsm has joined #ocaml
lolcathost has quit [Read error: Connection reset by peer]
Skolem has joined #ocaml
avsm has quit [Quit: Leaving.]
Yoric has joined #ocaml
<gustav__> Yeah, Bayesiean inference sounds similar to what business intelligence is. It's probably useful, any way.
<gustav__> I don't work with any of these things though.
<gustav__> Just a hobby.
<gustav__> Business Intelligence is a buzzword, I think...
<gustav__> It's in IDG, then it's a buzzword. <- More business intelligence. :)
tac is now known as tac-nap
emmanuelux has joined #ocaml
beckerb has quit [Quit: Konversation terminated!]
lolcathost has joined #ocaml
lolcathost has quit [Client Quit]
<gustav__> Who maintains Batteries? How is that done?
<ppseafield> How does ocaml implement comparison operators?
<flux> primitively
<flux> basically they are compared by their runtime reprepsentation
<ppseafield> Ah, so there's magic behind the scenes that figures out what strongly-typed comparison to use?
<pippijn> ppseafield: no
Xizor has joined #ocaml
<pippijn> the type system guarantees that the types are compatible
<pippijn> at runtime, it just traverses the object graph and compares integers and strings (and custom blocks with a custom comparator)
<ppseafield> pippijn: so I can write my own (<) for my own types?
<pippijn> the comparison operator doesn't know whether it is comparing an array or a tuple or a record
<pippijn> ppseafield: the polymorphic (<) does not use your (<)
<pippijn> because it has no type information
<ppseafield> so I *can't* write my own (<), at least not with that name?
<pippijn> you can write your own (<) with that name
<pippijn> it will hide the one from Pervasives
larhat has joined #ocaml
<pippijn> you can implement your own polymorphic (<), too
<pippijn> but only using unsafe interfaces
<ppseafield> pippijn: you mean do something special for my own type, and then default to the Pervasives one?
<pippijn> ok
<pippijn> try it :)
<pippijn> you can build anything
gnuvince has quit [Ping timeout: 252 seconds]
ontologiae has joined #ocaml
<pippijn> ppseafield: what would the type of that (<) be?
<ppseafield> I'm trying to understand if the Pervasives (>) etc. could be overloaded essentially
<pippijn> overloaded
<ppseafield> since it already seems to be overloaded for ints, floats, etc.
<pippijn> no, it's not overloaded
<pippijn> do you know the function "memcmp"?
<ppseafield> I don't
<pippijn> ok
<pippijn> Pervasives.(<) just compares bytes, basically
<pippijn> it doesn't know anything about the meaning (or type) of what it is comparing
<ppseafield> oh... thanks, that's what I was looking for
<pippijn> but you want this to solve a certain problem
<pippijn> what is that problem?
<gustav__> I think I know the answer.
<gustav__> 42.
<pippijn> gustav__: do you know the question?
<gustav__> pippijn: Yes.
<ppseafield> I was just curious how the 'a -> 'a -> bool function returned correct results without knowing type information
<pippijn> ppseafield: ok
<pippijn> now you know
<ppseafield> pippijn: so now by extension, does the order of possible constructors for a type effects the results of its comparisons?
<pippijn> yes
<thelema> ppseafield: to understand the builtin polymorphic compare works, you have to understand how values are represented in memory
<thelema> because it's these that are compared
<ppseafield> and each new possible constructor for a type gets an incrementing value "tag", i take it?
<thelema> pippijn: the builtin compare is a bit better than just comparing bytes; it's able to recurse through the structure of compound objects
<pippijn> thelema: I said that, but he didn't understand, so I simplified
<thelema> ppseafield: mostly; a constructor that takes arguments can have the same tag as constructor that doesn't
<thelema> pippijn: oops, I didn't read far enough back. sorry
<ppseafield> and since I see that (5, 3) > (5, 4) is false, is this a left-to-right comparison traversal?
<gustav__> I've got a bit on my screen.
<thelema> ppseafield: yes, mostly.
<ppseafield> pippijn, thelema: thanks for your explanations!
lolcathost has joined #ocaml
<thelema> ppseafield: you're welcome
<gustav__> Thanks everyone who's been talking to me, too. I don't know how to repay you. I'd like to be active in some project but I haven't really found a reeeally interesting one and I usually don't finish things. xD
<gustav__> Trying to push forward with my BI Application.
<thelema> :) welcome to #ocaml
<gustav__> :)
Associat0r has joined #ocaml
<thelema> write a blog post about your experiences with ocaml, or a mini-tutorial for doing some of what you're doing. That will more than repay our help
<gustav__> libapache2-mod-ocamlnet on Ubuntu could need some things done to it. It's not as updated as mod-php5, i.e. it doesn't work out of the box. But I don't know the objective of these packages, maybe you don't want to work like PHP.
<thelema> gustav__: we probably don't want ocaml to work like php
<gustav__> Okay. I'll try... hmm. Yeah, have to get a site first.
<gustav__> thelema: No, that's what I'm thinking.
<gustav__> The package is by no means broken, it took some tinkering to get it working, though. Maybe I could write that tutorial. Or a general overview...
<thelema> Any of that would help
<gustav__> I wanna try out camlbox. That stuff is neat.
<thelema> and it's really easy to set up a blog or other website
<gustav__> Yes, but I want a VPS... I think. I've been wanting to for many years.
<gustav__> I could bring out an old 800MHz Pentium 3 from the closet and run it on that. Thing is I only have ADSL right now. Bummerrr.
<gustav__> I think I'll be getting fiber. At home. Soon.
<thelema> I'd recommend something like weebly to start.
<thelema> or just use a github account and their markup.
<thelema> if you're feeling tech-macho
<gustav__> Yeah, right. I probably am. But I
<gustav__> 'll try Weebly.
<gustav__> I just want it minimal.
<gustav__> Weebly doesn't sound very serious...
<gustav__> x.weebly.com...
<pippijn> I have a question related to Lwt
<gustav__> I have to pay to remove their logo. :@
<pippijn> I have a program with two input sources: a network connection and a user
<pippijn> both operate on the same data
<pippijn> at the moment, it's like this: most of the time the server sends things and the client displays what the server sends
<gustav__> Have you tried hitting the user in the head?
<pippijn> but sometimes, the server asks the user something, so then I need to read user input
<pippijn> while asking the user, the server still keeps on sending things that the client needs to display
<pippijn> at the moment, asking the user blocks the whole process
<pippijn> how can I let these two things run concurrently?
<gustav__> Threads?
<pippijn> actually, I have an idea now
<diml> pippijn: how do you ask the user ?
<pippijn> diml: read_line stdin
<pippijn> I need to put user interaction into a separate thread
<thelema> pippijn: is there an lwt-enabled read_line?
<pippijn> yes
<pippijn> I'm using it
<diml> it shouldn't block...
<pippijn> it blocks because I coded it that way
<diml> ok
<thelema> pippijn: umm, then code it so it doesn't block?
<pippijn> thelema: the user input needs to modify data
<pippijn> and that data is constantly being modified by the network input, as well
<thelema> so it can do that when the line is read in...
<thelema> ah, sounds like you need the guarantees that async provides about non-interruptability
<pippijn> yes, but until the line is read, the rest of the program is waiting
<thelema> or you can somehow block the network after the line is read in
<pippijn> it would be easy if it actually modified data
avsm has joined #ocaml
<pippijn> but I didn't code it as modify
<pippijn> my data is immutable
<pippijn> so only 1 thread can ever modify data
<thelema> ok, so you need to tangle yourself in the folding that's happening on the network side?
<gustav__> http://gsifn.weebly.com/ Yay. :)
<pippijn> "modify"
<pippijn> right, the network responder is basically a fold over the network stream
<thelema> gustav__: not bad.
<gustav__> thelema: xD
<thelema> you need to extend that so it can take input from the user "thread"
<pippijn> yes
<pippijn> right
<gustav__> I have an old blawhg but I don't think anyone reads it: http://talkingtocomputers.wordpress.com/
<pippijn> hmm
<gustav__> And I got a lot of angry comments when I posted it to the PHP mailing list and stuff like that. They really don't like me.
<thelema> heh
<pippijn> thelema: do you think a mailbox-approach is the right way?
pango has quit [Read error: Connection reset by peer]
Yoric has quit [Ping timeout: 246 seconds]
<pippijn> in each iteration of the packet fold, a handler can add a user input request into the mailbox
<thelema> is it a problem if the handler needs network traffic to activate and check its mailbox?
<pippijn> hm.. no, I don't see the solution, yet
<pippijn> yes, that is a problem, but the handler could be extended to respond to user "Traffic", as well
<thelema> then that's the right solution
<pippijn> I already have 2 mailboxes
<pippijn> for server things
<pippijn> the client can request things from the server
pango has joined #ocaml
Yoric has joined #ocaml
Associat0r has left #ocaml []
<thelema> sorry, too complex for me to help with at the moment.
Xizor has quit [Quit: So yes it's mIRC under wine under debian double peche capital. ;) I'll soon see in kfreeBSD.]
<pippijn> doesn't matter
<thelema> can't multitask and help with multi-tasking code.
<pippijn> this code is actually irrelevant, I just wanted to show you so you know what I'm doing
<pippijn> this is a mailbox
<pippijn> I mean
<pippijn> use of a mailbox
<pippijn> 2 uses of a mailbox, actually
<pippijn> there: 1 use of a mailbox: http://paste.xinu.at/V81/ocaml
<pippijn> the user input needs to be async in the same way
<gustav__> http://gsifn.weebly.com/ <- Complete. Not tested.
<thelema> gustav__: any chance of box-styling the code / command lines / config files?
<pippijn> ah, another option would be to give the user interaction thread the "send" function
<thelema> pippijn: if that's what sends to the handler...
<pippijn> that sends to the server
answer_42 has quit [Quit: WeeChat 0.3.9]
<gustav__> thelema: Not with Weebly, I think.
<Qrntz> gustav__, Weebly allows you to use custom HTML/CSS as well
<gustav__> Yep, I'm converting it.
<pippijn> ok, I see my C++ version of this client modified global data
<pippijn> sucks
<pippijn> I need to redesign for ocaml
<pippijn> ("global" data)
<gustav__> http://gsifn.weebly.com/ There... hope you like the blink.
<thelema> the formatting is subtle, but enough, I think. The blink is out of place.
<thelema> also, it's OCaml, not O'Caml
<gustav__> Okay.
Cyanure has quit [Ping timeout: 252 seconds]
<gustav__> I think that will help people set up OCaml with Apache 2 if they want to.
<thelema> I might even follow these instructions
<gustav__> That would be good. I might have done other things it's been a while since I installed the packages myself. Like, yesterday.
<gustav__> I should include PostgresSQL, too. It will make it more meaningful, I think.
<gustav__> Hmm...
Yoric has quit [Ping timeout: 252 seconds]
<thelema> gustav__: also, it might help to have contact info on the page
<gustav__> There's another package with ocaml<->postgres bindings but I haven't tried that.
<gustav__> Yes, sure.
<thelema> or comments, without either, you can't get corrections/feedback
<gustav__> The Weebly editor is pretty advanced.
<gustav__> That's true.
<gustav__> So there.
<gustav__> Now I play the waiting game.
<thelema> that's you with the camera?
<gustav__> Is there an OCaml module that makes pizzas come out of your disc reader?
<gustav__> Nope.
<thelema> or just an odd piece of stock photo
<gustav__> It is.
<thelema> ok
<gustav__> I could take a picture.
<gustav__> But I am le tired.
<gustav__> I don't think people read blogs that don't update very often.
<gustav__> But anyway maybe they only read the newest post anyway.
<thelema> maybe, but if there's rss for weebly (I don't know about this...), we can put you on ocaml planet
<gustav__> Oh. Nice.
<gustav__> Fame! :D
<gustav__> I should find out what you need to get PostgresSQL to run, too. Hmm...
<gustav__> I should get VMs running on this machine.
<gustav__> For testing.
lolcathost has quit [Ping timeout: 256 seconds]
mjonsson has joined #ocaml
<gustav__> Right, I created a page, not a blog, so there is none.
<thelema> :(
ppseafield has quit [Quit: Leaving.]
<gustav__> This has a feed: http://gsifn.weebly.com/blog.html
lolcathost has joined #ocaml
<gustav__> The blogeditor is annoying. Things jumping around. But it works.
eikke has joined #ocaml
<gustav__> Dropbox as a database is nice.
<gustav__> Make sure you save that data encrypted.
<gustav__> :)
elixey has quit [Ping timeout: 276 seconds]
<gustav__> But I really wonder if cryptology as is understood as the most secure today, i.e. RSA public key, really is that secure... it seems to rely on a paradox in mathemathics, or at least an unsolved problem, so, when that problem is solved, all data protected today, will be easy access. :) Not very secure. And/but a very big incentive to crack that math problem.
elixey has joined #ocaml
<K_F> that problem is more interesting to discuss in the context of quantum computing
<gustav__> I guess the economics mathematics professors came up with that one.
<Pantoufle> NSA and corporations watch every bit of research done in this field
tane has quit [Quit: Verlassend]
<Pantoufle> And IIRC now the trend is elliptic curves
<K_F> yup
<gustav__> They should.
<gustav__> Or... what are they hiding? ;)
<K_F> Got RFC6637 earlier this year (ECC in OpenPGP), so already implemented in GnuPG 2.1 and SKS 1.1.4
<gustav__> If you have nothing to hide you have nothing to fear. ;)
<K_F> seems GnuPG 2.1 won't support my 15,360 bit RSA key, so "had to" create a ECDSA/ECHD keyset as well
elixey has quit [Read error: Connection reset by peer]
<gustav__> Are 2048 bit keys crackable?
<K_F> although WK doesn't seem to consider that a regression
lolcathost has quit [Ping timeout: 252 seconds]
<gustav__> I almost don't know what I'm talking about. But. Can I revert that cipher.
<K_F> gustav__: quite possibly
<gustav__> ...
<gustav__> My processor has AES instruction. I don't get that. Isn't AES outdated?
<gustav__> Humm...
<K_F> lets stick to RSA first.
<K_F> but let me dig up some articles on sieving..
* K_F needs to organize his archive better
lolcathost has joined #ocaml
uselpa has joined #ocaml
<gustav__> I have to brush up on RSA. I can't remember how it works.
uselpa has left #ocaml []
<gustav__> Doesn't RSA work by having one part of the components hidden? The private key? Can you calculate that?
<K_F> it relies on factoring of large primes
<K_F> or rather, the difficulty of doing so
<K_F> unless discussed in the context of quantum computers
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
<gustav__> What does hardware have to do with solving mathematical problems? Really...
<gustav__> Hmm.
<K_F> how much have you read up on quantum theory?
<gustav__> Doing many things the same time?
<gustav__> 3?
<gustav__> 42?
<K_F> the 4th paragraph should be most relevant to this discussion
<gustav__> Uhm. I see.
<gustav__> But then I just use a quantum computer to compute large primes, problem solved?
<K_F> but rather than to go too deep into that, you also mentioned AES?
<gustav__> Like suuuuuperbig.
<gustav__> Yes.
<K_F> gustav__: no, you find another mathematical problem to work on (mainly Elliptic Curves)
<K_F> But I'm heading out of here in 10 mins or so, so to answer your AES question - no, it is not outdated
<K_F> why would you think it is?
<gustav__> Good.
<gustav__> It's 256 bits.
<gustav__> I haven't studied it, so I don't know what that refers to.
<K_F> symmetrical cipher of 256 bits has the rough equivalent shannon entropy of SHA512, NIST P-521 and RSA15,360
<gustav__> Oh. AES is safe from quantum computers?
<K_F> nothing is safe
<K_F> but it certainly won't be affected as much as RSA
<gustav__> Isn't it possible to create a safe cipher?
<gustav__> Has that been proved?
<K_F> but you shouldn't really confuse symmetrical and asymmetrical encryption
<K_F> you never know if it is safe until it has been broken
<thelema> only OTP is proven safe. everything else is either "maybe safe" or broken
<thelema> for varying degrees of maybe
<K_F> yup..
<K_F> and the implementation / application of the cipher might break things, thinking specifically of the lorenz cipher
<gustav__> I wonder if OTP is safe, because of social influence. A person, a human body, emits a lot of information.
<gustav__> Take a picture of a body and you have 4000x4000 pixels of information or something like that.
<K_F> "The German mistake" section.. reducing the message by 500 chars or so ...
<gustav__> Couple that with passwords...
<K_F> BAD IDEA..
lolcathost has quit [Ping timeout: 252 seconds]
<gustav__> Yes, OTP can be broken if you access a machine who generated the passwords and there's a swap and that swap space hasn't been overwritten or similar...
<K_F> gustav__: for the purposes of this discussion, then it isn't OTP
<gustav__> So there needs to be some new theory not relying on a race of solving a math problem. Like the list of all primes.
<gustav__> K_F: What do you mean?
<gustav__> Oh... well. Sure it is. You use 1 of 4 password. I use the rest of 3 of 4.
lolcathost has joined #ocaml
<gustav__> Because those are still in that swap space on that server that generated them for you.
elixey has joined #ocaml
<K_F> I fail to see where "passwords" come into this
ftrvxmtrx has quit [Ping timeout: 252 seconds]
<gustav__> I think coding everything you think or say is the only way to be safe.
<gustav__> Rolling language evolution, so to speak.
<gustav__> And these things are really, hard to do when you don't know the application.
<gustav__> It's not like we're attacking tanks, here.
<gustav__> But a Forever Crypt would be nice.
<gustav__> Better to write things on a paper and lock it in a box, I think.
<gustav__> Computers can't read that. :)
<gustav__> US drone, might, sure... in the future.
<gustav__> x)
<K_F> well, I'm heading to bed anyways..
<K_F> capitulating to the influenza
<gustav__> Alright. Sleep well.
<gustav__> Ah.
lolcathost has quit [Ping timeout: 260 seconds]
<gustav__> What's the difference between OTP (one time pad) and OTP (one time password?) None, I say. Uh...
<gustav__> One is harder to read, for a human.
<gustav__> But I keep excluding algorithms here.
<thelema> one time pad is used for encryption
<thelema> one time password is just an authenticator
<thelema> totally different uses.
<gustav__> Sure.
<thelema> one time pad must be as long as the message you want to send
<thelema> one time password must be long enough to evade guessing
<gustav__> Pad sounds like Scytale. :)
<gustav__> They're not that similar.
<gustav__> If they stop making quantum computers to solve RSA, it won't be solved. So that might be something to think about.
<gustav__> Like not blowing up the planet with a nuclear bomb.
<gustav__> Two bad ideas.
<gustav__> You don't HAVE to do everything.
<gustav__> Someone has to construct a computer to decipher all RSA encoded transmissions, too.
<gustav__> Just Don't Do It<tm>.
<gustav__> Damn, now I feel useless. Here I am, thinking about pigeons.
<gustav__> What good has ever thinking about pigeons done humanity? :(
<thelema> back to OCaml
<gustav__> Yep.
lolcathost has joined #ocaml
avsm has quit [Quit: Leaving.]
<gustav__> I have other things to do too, though.
lolcathost has quit [Ping timeout: 260 seconds]
lolcathost has joined #ocaml
Neros has quit [Read error: Connection reset by peer]
avsm has joined #ocaml
<pippijn> this doesn't work: http://paste.xinu.at/4HfY/
lolcathost has quit [Ping timeout: 265 seconds]
<pippijn> is there a way to do this?
<thelema> pippijn: write constants : | 0 -> ... | 3 -> ... | 5 -> ... | 6 -> ...
<pippijn> not nice
<pippijn> these expressions have a meaning
<thelema> or write a decompose function, and match pairs, although I don't know how you're decomposing...
<pippijn> that meaning is lost
<pippijn> if I write constants
<thelema> put the meaning in a comment?
<thelema> pippijn: big comment before function
<pippijn> meh
Cyanure has joined #ocaml
<pippijn> it compiles a guarded match to inefficient code :(
<thelema> pippijn: yes, Variants aren't meant for doing what enums like this do.
<thelema> if you really wanted, you could use a nasty variant declaration and Obj.magic to convert.
lolcathost has joined #ocaml
<thelema> this would have high performance but be brittle
<pippijn> no need for performance in this part of the code
<thelema> good.
<thelema> oh, for low performance, "| x when x = 0 * 2 + 0 -> ..."
<pippijn> yes
<pippijn> I did that
<pippijn> I looked at the asm
<pippijn> very bad
eikke has quit [Ping timeout: 240 seconds]
<thelema> it's a sequential if/then/else
<thelema> right?
<pippijn> yes
<pippijn> let me check what exactly it is
lolcathost has quit [Client Quit]
<pippijn> yes
<thelema> yup
<pippijn> with constants, it's a jump table
<pippijn> looks nice :)
<thelema> hmm, factoring in branch prediction, I'd need to see benchmarks before declaring one terrible.
<pippijn> thelema: right
<thelema> best would be enumerating the variants so their representation is the same as the int they correspond to
<pippijn> well yes
<pippijn> but no :)
<pippijn> not here
<pippijn> this is fine
<thelema> good choice. Maybe someday we'll have system-programming extensions like this in OCaml.
<thelema> or maybe someone will do the work in an ppx
bitbckt has quit [Quit: out]
theplanet^2 has joined #ocaml
elixey has quit [Ping timeout: 276 seconds]
bitbckt has joined #ocaml
naquad has left #ocaml []
xavierm02 has quit [Quit: Leaving]
Cyanure has quit [Remote host closed the connection]
avsm has quit [Quit: Leaving.]
<gustav__> Goddamnit. netcgi doesn't allow mixing of GET + POST arguments... :/
<gustav__> Hurr.
travisbrady has quit [Quit: travisbrady]
avsm has joined #ocaml
Neros has joined #ocaml
avsm has quit [Client Quit]
smondet has quit [Ping timeout: 264 seconds]
<tac-nap> impedance mismatch!
gustav__ has quit [Read error: Connection reset by peer]
jamii has quit [Ping timeout: 246 seconds]
Yoric has joined #ocaml
Skolem has quit [Quit: Skolem]
gustav__ has joined #ocaml
<pippijn> can I build a camlp4 pa_-module and use it in the same project with oasis?
tautologico has joined #ocaml
pkrnj has joined #ocaml
andreypopp has quit [Quit: sleep]
tac-nap has quit [Quit: Page closed]
Yoric has quit [Ping timeout: 252 seconds]
lolcathost has joined #ocaml
pkrnj has quit [Quit: Computer has gone to sleep.]
maufred has quit [Ping timeout: 248 seconds]
maufred has joined #ocaml