<pango>
you didn't answer, what type should function accumulate have ?
<pango>
what you pasted doesn't type
l_a_m has quit ["Lost terminal"]
triple_ has joined #ocaml
l_a_m has joined #ocaml
<pango>
for example, since you add arg1 and arg2 with +, they must be ints; hence the first branch of the match returns an int, whereas the second returns a foo...
<knobo>
If i could understand how this works....
<knobo>
can convert a foo to int somehow?
<pango>
sure, deconstruct values of type foo with pattern matching
<pango>
match my_foo_value with Int i -> i ;;
<pango>
(of course it will warn you that the match is not exhaustive)
<pango>
if the pattern matches, any variable in the pattern gets bound to its matching value, for the scope of the matching action
<pango>
an example of function that types correctly:
<pango>
let f arg1 arg2 = match arg2 with
<pango>
| Int i -> arg1 + i
<pango>
| Fun f -> f arg1 ;;
<pango>
val f : int -> foo -> int = <fun>
<pango>
still lost ?
<pango>
did you already use pattern matching on predefined types, like lists ?
<pango>
I think it's easier to understand what's going on by reading parsers in reverse order
maayhem has quit [Read error: 110 (Connection timed out)]
maayhem has joined #ocaml
<dark_light>
something new to me :>
<pango>
haven't used streams before either :)
<dark_light>
pango, i was thinking in separate the "last parameter", if exists, from the message.. like :test a b c :my test turn to Some "test", Some "my test", ["a"; "b"; c].. with my current function seemed too hard (or at least expensive) because i will only know if i had a last parameter at the last call
<dark_light>
but using parsers it seems it is only a matter of changing parse_begin..
<dark_light>
or maybe i didn't understand how it works :P
<pango>
you mean keep what's after ':' separate from other parameters ?
<dark_light>
sim
<dark_light>
oh
<dark_light>
yes
<dark_light>
lol
chessguy has joined #ocaml
smimou has joined #ocaml
Payo543 has joined #ocaml
<Payo543>
w000t
<pango>
mmmh I don't know if there's any way to 'pick' over the next element in stream without actually destroying it
<Payo543>
pango, check out euphoria programming language
<pango>
oh, language of the day ? :)
<Payo543>
pango, :D
<Payo543>
check it out
<Payo543>
it rules
<dark_light>
pango, language of the day, that's a great idea.. i think there are more than 365 active programming languages, so it would last at least one year
<dark_light>
:>
ikaros has quit ["- I want to die by going supernova and then collapsing into a black hole. I could then spend eternity sucking in everything t]
<pango>
I heard around 7000 programming languages were invented
ikaros has joined #ocaml
<pango>
Payo543: lots of adhoc coersions, yuck
<pango>
{1,2,3} + 5 = {6,7,8}
<dark_light>
puts(1,"Hello World!\n") > this 1 is an file descr? o_o
<Payo543>
dark_light, pango the language of the future
<dark_light>
Euphoria source code can be "bound" to the Euphoria run-time code to produce a stand-alone program for distribution. The code may also be "shrouded" to prevent others from viewing, copying, or changing the source. > not an wonderful feature, eh
love-pingoo has joined #ocaml
<pango>
Payo543: thanks, but no, thanks
<Payo543>
pango, its going compeltely open source
<pango>
I had enough of this kind of datastructures with Perl already
<Payo543>
and its the fastest scripting language
<pango>
speed kills
<Payo543>
and the 2 C trans is as faster then c++
<dark_light>
Payo543, faster than c++, representing chars as ints? hmm
<dark_light>
but well do not seem a very bad idea at all=)
<Payo543>
dark_light, read performance charts on it
<pango>
dark_light: not unusual with unicode
<dark_light>
pango, really? i though utf-8 would be a better encoding
<dark_light>
Payo543 hmm.. link? :>
<pango>
dark_light: for immutable strings, maybe
<dark_light>
pango, hm..
<abez>
I made a programming language. It executed first order and temporal logic. TOTALLY USELESS.
<abez>
and ocaml's awesome pattern matching would've helped SOOOOOOO much
<Payo543>
dark_light, debian shooout i think has it :P
<pango>
"Unlike other languages such as LISP and Smalltalk, Euphoria's "garbage collection" of unused storage is a continuous process that never causes random delays in execution of a program, and does not pre-allocate huge regions of memory." <- smells like reference counters
<pango>
that documentation is full of similar crappy statements
<Payo543>
pango, i just mentioned it as cool :P you dont have to use it
<pango>
Payo543: what a relief
<Payo543>
its just the worlds fastest scritping langauge that you can trnaslate that to C code also and have C code as fast as hand optimized C code ......well close to it
ppsmimou has quit [orwell.freenode.net irc.freenode.net]
<Payo543>
pango, it has very much high level stuff but also can do low level stuff
<pango>
Payo543: it's not high level in my view, I already said that
<abez>
What is the license of this language
<pango>
Payo543: and enough of that crappy environment in this channel
<Payo543>
pango, more high level then basic in my eyes
<Payo543>
abez, Public domain open srouce in a few days
<abez>
mmm not touching it til then
<Payo543>
abez, still free now though
<Payo543>
pango, :) your such a hater
<abez>
FSF free or free
<Payo543>
i think ocaml is great tooo but i think euphoria is also cool :)
<Payo543>
and lua btw
<abez>
9. Evil Intent
<pango>
go impress #cobol instead
<abez>
You may not use the source to create any viruses, worms, trojans or other software that is intended to cause damage to any computer systems or networks, or that would intentionally harm the reputation of Euphoria or RDS.
<abez>
>:( totally non-free
<Payo543>
abez, 2 days it will be public domain
<abez>
where are some example programs
<Payo543>
and why would you not agree with that
<abez>
It isn't PD right now
<Payo543>
abez, rapideuphoria.com has a huuuuge communtiy and like 1600 examples or something
<Payo543>
abez, what did i just say .......2 days :P
<Payo543>
i just talked to the maker a 3.0.0 release ic coming out
duncanm has quit [Read error: 110 (Connection timed out)]
Carillon_ has quit [Connection timed out]
mikeX has joined #ocaml
<setog3>
how can I now what is the code of a "predefined function" (* Liste.fold_left for example *) :D
<pango>
by looking at the sources
<pango>
list.ml, in occurence
<pango>
(functions are abstract values in OCaml)
TSC has quit [Connection timed out]
<setog3>
I cant do something like ?function ..
<pango>
they're abstract
<pango>
# List.fold_left ;;
<pango>
- : ('a -> 'b -> 'a) -> 'a -> 'b list -> 'a = <fun>
<pango>
so the value displayed is "<fun>"
<setog3>
thx pango ..
<setog3>
you are the only man on this chan who don't ask but only reply !
<pango>
well, I can ask too ;) Is it possible to lookup one element ahead (= non destructively) with camlp4 streams ?
<setog3>
:D .. I have the response of this question .. but I prefer you search a little before I say it to you !
TSC has joined #ocaml
<abez>
pango: I thought peek was defined in streams?
<pango>
but can they be used in camlp4's parsers ?
Smerdyakov has quit [Read error: 110 (Connection timed out)]
* abez
shrugs
<pango>
well, I guess I could, instead of using pattern matching...
Smerdyakov has joined #ocaml
<Payo543>
do you think ocaml will ever optimize the opt thingy to where it can output smaller binraries ?
<Payo543>
bin
<dark_light>
Payo543, why you need small binaries?
<Payo543>
dark_light, pure curiocity
<bluestorm>
ocamlopt -nostdlib ?
<abez>
because he's a l33t hax0r and has to keep his statically compiled bins small so he can get the hax through.
<bluestorm>
^^
<Payo543>
bluestorm, whats that do ?
<bluestorm>
Payo543: don't link with stdlibs until you explicitely ask him to, i guess
<Payo543>
dont you need the stdlib though ?
<bluestorm>
bah
<bluestorm>
you make by example
<bluestorm>
-nostdlib list.cma
<bluestorm>
so you use lists, but don't link to the whole stdlib
<bluestorm>
hum
<Payo543>
lol i am confused
<Payo543>
well how much smaller does this make it ?
<bluestorm>
.cmxa actually
<bluestorm>
hum
<bluestorm>
i never tried it
<bluestorm>
i'm not a speed/size maniac like you
<pango>
bluestorm: I think it modifies search path, but libs are still searched for (so it fails)
<pango>
$ ocamlopt -nostdlib -o burp burp.ml
<pango>
>> Fatal error: cannot open Pervasives.cmi
<pango>
Fatal error: exception Misc.Fatal_error
<Payo543>
bluestorm, me either but my jabber client in bytecode form is 300 kb including lablgtk
<Payo543>
i dont want to know what it is in opt form
<pango>
probably below 500kB
<Payo543>
actually i think it was 280 kb in bytecode form
<Payo543>
pango, do you htink stripping would also make it smaller ?
<pango>
give it a try
<Payo543>
will do
<Payo543>
does stripping usually make it smaller by like 20 percent or what ?
<bluestorm>
haha pango you seems right
<pango>
depends on the number of symbols defined
<bluestorm>
i misread the explanation in --help :-°
<bluestorm>
hum Payo543, what's the problem with 300kB ?
<pango>
got a large binary here, stripping it reduces its size by ~ 35%
duncanm has joined #ocaml
<pango>
bluestorm: -nopervasives looks more radical, but I don't know how to compile anything without pervasives ;)
<Payo543>
pango, how large :D
<dark_light>
pango, i think you can roll your own C libraries to link against ocaml
<dark_light>
:>
<pango>
dark_light: yes, that's probably the use of such parameter
<pango>
Pervasives is not the only library that linked implicitly btw... Never had to link String, List,...
<pango>
But, much like Pervasives, I guess not that many ocaml programs can do without them...
<dark_light>
i though ocaml would link only what it uses
<dark_light>
i think it's easy to determine if String isn't being used at all
Kzzch has joined #ocaml
<pango>
mmmh probably correct... The size difference between /dev/null and let s = String.make 1 ' ' is > 20kB
<pango>
I guess it's not the size of that expression :)
<bluestorm>
^^
<pango>
but granularity must be the module
<pango>
(even then, that looks a bit large... string.cmx is < 2kB)
<pango>
I suspect it automatically linked List, Char, and String
<pango>
let a = 2 in print_int a didn't... So if you restrict yourself to Pervasives, I guess it links nothing superfluous
<Payo543>
pango, before i get all into the gui stuff here do you think its betteer to use a wxwidgets kinda thing or just use GTK on windows as well ?
<pango>
I'm not a GUI guy, much less on windows
<Payo543>
pango, but i need it on both platforms
<mikeX>
gtk seems to work just fine on windows
<pango>
you asked me personally, I answered
<dark_light>
i like the idea of wxwidgets because its renders to "native" win32 windows on windows.. but gtk themes are generallty better than the windows visual
<pango>
heard of a gtk-wimp theme with windows look (then again, which one ?)
TSC has quit [Read error: 110 (Connection timed out)]
<Payo543>
dark_light, yes but i need to to pick :P
chessguy has joined #ocaml
delamarche has joined #ocaml
Smerdyakov has quit [Read error: 110 (Connection timed out)]
delamarche has quit [Client Quit]
Smerdyakov has joined #ocaml
duncanm has quit [Read error: 110 (Connection timed out)]
<abez>
Payo543: Go GTK all the way
<abez>
Payo543: it is a better toolkit and works well on both platform
<Payo543>
abez, thats what im thinking also
<Payo543>
just exploring all possibilities
<abez>
Payo543: I've just seen too many horrible examples of wxwindows in python to really support its use.
<abez>
Payo543: but hey that's just my opinion.
<dark_light>
abez, i never used both, but i like the idea of wxwidgets. maybe it was only underperformed
<Payo543>
i seee
<abez>
are the wx bindings for ocaml any good?
<dark_light>
actually i would thanks the Qt and GTK guys if they merge all into one lib with two interfaces (the gtk and qt ones). i don't care about the win32 gui
_fab has joined #ocaml
<Payo543>
dark_light, its good to have variety
<dark_light>
its good to have standards too
<abez>
Qt is basically their own language (MOC)
<Payo543>
dark_light, theres big following for both GTK and QT
<dark_light>
MOC?
<Payo543>
dark_light, MOC == Moucha ouata Carbunto
<dark_light>
? :o
<Payo543>
lol
<Payo543>
language inside language
<Payo543>
I think thats what he meant
<dark_light>
:)
ulfdoz has quit [Remote closed the connection]
ulfdoz has joined #ocaml
<Payo543>
dark_light, i will be in Rio De Janerio in 3 days
<dark_light>
=)
<Payo543>
dark_light, how old are you ?
<dark_light>
18
<dark_light>
and you?
<Payo543>
dark_light, well i have ear rings ...liek little diamonds (fake) but yea ........is this accepted in brazil ?
<Payo543>
19
<Payo543>
dark_light, in usa some people like it ........some people think its gay .....but the hip hop crowd has got em
<dark_light>
Payo543, well a bit strange :E but the ones without those brilliants are very common
<Payo543>
brilliants ???????/
<dark_light>
aaaaaa
<Payo543>
i think are you using brillliants wrong ;)
<Payo543>
brilliant is intelligent
<Payo543>
you are a brilliant person
<bluestorm>
shining ?
<dark_light>
Payo543, here brilliant can be "what brights" too
<Payo543>
ahhh
<Payo543>
ahhh
<Payo543>
i like em bright and shiny :D
* dark_light
with severe difficulties in english
<Payo543>
st8t Ballling
<dark_light>
well don't worry at all :P :P :P
<Payo543>
dark_light, your almost right with brilliant .........theres a word similiar to it for bright but i forget :)
<Payo543>
dark_light, also should i translate my name or keep it the same ?
<dark_light>
Payo543, normally people here loves foreingers, americans and that kind of stuff.. so the people heres likes to speak the name in english. but i would translate anyway=)
<Payo543>
dark_light, well have you ever heard the name, Joshua Anthony before ?
shawn has quit ["This computer has gone to sleep"]
<dark_light>
yes, i remember some joshua :o
<Payo543>
you never heard Anthony before ?
<dark_light>
anthony yes
<dark_light>
there are antônio here
<dark_light>
how is joshua in portuguese?=)
<Payo543>
yes smae in spanish
<Payo543>
i thought it was like josue
<dark_light>
ah
<dark_light>
josé!
delamarche has joined #ocaml
<dark_light>
ahahaha, nice! here you are zé antônio
<Payo543>
z?
delamarche has quit [Client Quit]
<Payo543>
what does the z sound like in English ?
<dark_light>
like zap
<dark_light>
(there are an zap in english, right?)
<Payo543>
zap means to like zap you with a laser gun
<dark_light>
josé is often called zé. you can even be called zé toinho for the friends. eheheh =P
<Payo543>
what does jos sound like ?
<Payo543>
same in english ?
<Payo543>
does jos sound the same ?
<dark_light>
Hmmm.. i don't know, :o
<Payo543>
Joshua -> Josh
<Payo543>
btw i think Anthony sounds better then Antonio =P
duncanm has joined #ocaml
<dark_light>
Payo543, jos has the j like jay (well a bit different =P)
<Payo543>
i have people that call me antonio all the time
<dark_light>
really?
<Payo543>
yes
<Payo543>
theres a major spanish influence and italian influence
<Payo543>
some of my family is italian
<dark_light>
:)
<Payo543>
Anthony kinda sounds like Antony
<Payo543>
the h is rarely pronounced
<dark_light>
Payo543, well i would prefer translate because, well.. because i prefer ^^'
<Payo543>
whats your name ?
<dark_light>
elias gabriel.. in english elias is, well, elijah
<Payo543>
eli for short
mikeX has quit [Read error: 110 (Connection timed out)]
<dark_light>
dark for short
<dark_light>
lol
<Payo543>
lol
* dark_light
hates the name elias
<Payo543>
people in usa name their kids weiiird names these days
<dark_light>
Payo543, weird?
<Payo543>
yea
<Payo543>
funky names ;)
<Payo543>
like ......Charity
<dark_light>
:)
<Payo543>
stupid sounding names
<dark_light>
here too..
<Payo543>
i am glad my mom names me Joshua Anthony
<Payo543>
and not some wierd thing
<Payo543>
Joshua they say is like a real common name but i never hear it met maybe a total of 5 josh's my whole life
<Payo543>
but i always use my middle name .....Joshua Anthony some people dont use their middle names
<Payo543>
Joshua in english sounds like .... Jo shoe wahh
Snark has quit ["Leaving"]
shawn has joined #ocaml
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- IRC for those that like to be different"]
<Payo543>
how do i know if i am using the standard library ?
<Payo543>
pango, for the sake of me obsessing over what language to use, since i already started i will continue using ocaml for my jabber client
<abez>
language will help you start your program
<abez>
but it is truly up to you to finish and maintain it
<pango>
so short answer is, yes, you'll probably need a reference, or another mutable value
<Payo543>
a gloabal variable
<Payo543>
something that chnages to a new screenmae every 20 seconds
<Payo543>
also should i do sock_send / sock_recv OR should i use the GTK GIO channel stuff ?
<Payo543>
and is the LablGTK binding fast?
<Payo543>
someone in here said mldonkey was slow
<Payo543>
i don't know if it uses lablgtk or not
malc_ has joined #ocaml
<pango>
recent versions of mlgui uses lablgtk2, yes
<Payo543>
is it fast now ?
<Payo543>
i remember someone was complaining that it was slow once
<pango>
it's probably as slow as usual, nobody works on it
<Payo543>
but that was a while ago
<Payo543>
welll
<Payo543>
is it becasue of LablGTK
<Payo543>
or just programmed bad ?
<pango>
who knows
<Payo543>
lol
<Payo543>
well i dont want a sluggish jabber client
<Payo543>
cause the damn lablgtk bidning was written poorely
<pango>
you're wrong
<Payo543>
?
<Payo543>
pango, ?
chessguy has joined #ocaml
<pango>
Garrigue is a very smart guy, no doubt a lot of time and effort was put on lablgtk
<pango>
that said, you have to learn OCaml to use it
<pango>
because it uses several advanced features
<pango>
polymorphic variants (using contravariants for subtyping), and of course objects, afaiu
<pango>
maybe someone that used it could give more accurate details ;)
<malc_>
fwiw usage of objects in lablgtk is optional
Mr_Awesome has joined #ocaml
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- IRC for those that like to be different"]
<pango>
malc_: relying purely on polymorphic variants ?
<malc_>
pango: that's not what i meant, object wrappers are built upon pure wrappers, one can opt to use the former alone
<pango>
ic
<Payo543>
malc_, can you expalin some more ?
<Payo543>
and is lablgtk slow from your usage ? i wouldnt expect it so since its just a wrapper
delamarche has joined #ocaml
<malc_>
Payo543: i only wrote one lablgtk program, so am no good as adviser, write to lablgtk mailing list or to author directly if you are having troubles
<Payo543>
malc_, i havent even used it yet
<Payo543>
malc_, i just wanted ot knwo if lablgtk is fast and responsive etc
delamarche has quit [Client Quit]
<malc_>
Payo543: gtk by itself is slow and unresponsive, but that's just my biased opinion
<Payo543>
malc_, gtk is faster then qt
<malc_>
Payo543: and you made that observation based on what measurements?
<Payo543>
hmmmmmmmm
<Payo543>
trolltech said that
<Payo543>
=D
<malc_>
where?
<Payo543>
so its not my observation .....its the peoples who made it :P
<Payo543>
it was on there mailing list and look at benchmarks
<Payo543>
what are you a qt lover and just discovered the truth :P
<Payo543>
even ask in #qt
<Payo543>
qt is a language inside of a language so much more overhead
<malc_>
you talk too much
<Payo543>
malc_, wtf ?
duncanm has joined #ocaml
<Payo543>
malc_, also how do i use lablgtk without all the object stuff ?
<malc_>
Payo543: you just use bare bones gtk wrappers lablgtk provides, not the OO wrappers
<Payo543>
i seee
<Payo543>
i assume this would be a little better performance wise as well
<malc_>
hardly
_fab has quit [Remote closed the connection]
<Payo543>
well any overhead casues a performance loss
delamarche has joined #ocaml
<pango>
and vice versa
<pango>
thanks for the truism
Mr_Awesome has quit ["...and the Awesome level drops"]
<pango>
there's also a rule of optimization: if you make some code responsible for 1% of the CPU time twice as fast, the whole process is now 0.5% faster
<pango>
I doubt that method dispatch (or even some more) takes any measurable time vs. gtk, gdk, Xlib, socket communications, and finally X server
<pango>
oups forgot video card
<pango>
what is slow in mlgui, from what I understand from the comments in the sources, is that display uses some kind of list with shrinkable sublists. All this with updates.
<pango>
Somehow it doesn't map efficiently to the feature provided by the gtk widget used, specially finding the sublist elements to update them
<pango>
I don't know who's to blame there; gtk for not providing the right API; or the application for chosing the wrong widget for the job
<pango>
(or, third possibility, lablgtk for not exporting some of the API ?)
dark_light has quit [Read error: 113 (No route to host)]
smimou has quit ["bli"]
<Payo543>
pango, your to blame
<pango>
mmh ?
<Payo543>
? =)
<pango>
I'm in no way related to that code, so what do you mean?
<Payo543>
apparently you are sense you know the exact problem
<Payo543>
you caused mldonkey to end up that way
<pango>
it's written in comments
<Payo543>
yea yours
<pango>
I'm merely reading comments and what I understand from the code (not much since that part is mostly OO)
<Payo543>
pango, im just f*cking with you
<pango>
am I to blame for reading comments ?
<Payo543>
^^
delamarche has quit []
<Payo543>
time ot get this thing done
<Payo543>
been like 3 weeks since i worked on it
<Payo543>
let me see if i can blow away a ton of it tonight
<Payo543>
w00000t
<abez>
premature optimization just makes you into a game programmer hobbyist
<abez>
you get nothing done
<abez>
and finish nothing
<abez>
worse, you never truly learn how to carry through and make an application usable.
<abez>
(* there are exceptions to this rule but game programmers are notorious bunch *)
Mr_Awesome has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
chessguy has joined #ocaml
ikaros has quit [Remote closed the connection]
postalchris has quit ["Leaving."]
<Payo543>
<< is having problems installing lablgtk