<dsheets>
uhhh, remember he also won't let you make anonymous functions with statements inside them
<dsheets>
and defends the inefficiency of higher-order functions in favor of comprehensions
<dsheets>
so, no, i think he is quite serious that "elimination of stack traces" is a showstopper
<companion_cube>
list comprehensions are a cool feature though
Tobu has joined #ocaml
<everyonemines>
really? I think they make code harder to read than maps.
<_habnabit>
no way
<yezariaely>
I you are used to them, they are more easy
<_habnabit>
also the thing about anonymous functions is misguided
<_habnabit>
the thing you should really be complaining about is that python doesn't let you have assignment as an expression
<_habnabit>
(which is a much more useful feature than just 'multi-statement anonymous functions', which makes no sense)
<_habnabit>
((and, fwiw, TCE is totally possible in python. I even implemented it _in python_ for python))
<companion_cube>
everyonemines: but when you combine a filter and a map into a comprehension, it's a readability win
<dsheets>
_habnabit: how about the fact that statements don't have values? aka there are things that are not expressions. Regardless, his stated reasoning is to discourage the use of lambda.
<everyonemines>
_habnabit: I mean filtermap.
<everyonemines>
Haven't you heard of filtermap?
<everyonemines>
It's a thing.
<_habnabit>
everyonemines, what?
<everyonemines>
In the set of map functions.
<dsheets>
_habnabit: with a trampoline?
<_habnabit>
dsheets, nope. it just does bytecode hacking.
<_habnabit>
rewrites the CALL_FUNCTION opcode into a JUMP_ABSOLUTE opcode
<dsheets>
_habnabit: nice! is python bytecode portable?
<everyonemines>
In other words, I think it's better to use an appropriate map function than introducing special syntax for something like that.
<_habnabit>
vaguely
<_habnabit>
everyonemines, the difference is that python has 'an iterable thing' as a language concept and ocaml doesn't
<_habnabit>
everyonemines, so, it makes less sense in ocaml because of that
<_habnabit>
everyonemines, but it doesn't mean it's a bad idea
<companion_cube>
everyonemines: well, the philosophy of python is to add features in the language
<dsheets>
_habnabit: so if you run a python service, you can rely on tco through bytecode transform but you can't ship tco-heavy apps?
<companion_cube>
and also, you can do lazy comprehensions
<_habnabit>
dsheets, it's a joke; I wouldn't rely on it ever
<companion_cube>
which are cool to build other structures
<_habnabit>
dsheets, but it was a proof-of-concept joke. it's totally a doable thing in python.
<everyonemines>
You can make iterable things in ocaml. Just do a partial application to a ref.
<dsheets>
_habnabit: yeah but not actually usable so the language is still gimped
<_habnabit>
everyonemines, what ???
<_habnabit>
dsheets, huh? what's not usable?
<dsheets>
_habnabit: hacking python bytecode to jump instead of call
<dsheets>
_habnabit: the semantics of the source change and you need a special environment, yes?
<_habnabit>
dsheets, sure it's usable. if python implemented TCE, that's how it would be done.
<_habnabit>
dsheets, well, if by 'special environment' you mean 'a particular python implementation'
<_habnabit>
it's not implementation-agnostic
<companion_cube>
everyonemines: seriously...
<everyonemines>
let f x () = incr x; !x ;; let o = f (ref 0) ;; o();; o();;
<_habnabit>
everyonemines, okay? have you ever used python?
<everyonemines>
Hmm, not what you meant?
<companion_cube>
set(x+2 for x in foo if x not in blah) ← this is the kind of comprehensions python is good for
<dsheets>
_habnabit: yes, it is possible but if the BDFL says "ni" why does it matter? It's also possible in javascript but you can't write javascript expecting TCE unless you control its runtime
<everyonemines>
You can use x as the index into an object.
<_habnabit>
in python, if you do `for x in y:`, y must be an iterable thing
<everyonemines>
Then have some transform applied based on another function argument.
<_habnabit>
'iterable' is a language-defined concept; it's a unified thing
<dsheets>
isn't it actually done with magic properties, though?
<_habnabit>
and ocaml doesn't have that. yes, you can approximate it, but _there's no interface enforced by the language_
<dsheets>
you can pierce the iterable abstraction, no?
<everyonemines>
Basically, you just want a map of a function with some internal state.
<dsheets>
_habnabit: syntax extension! :-P
<companion_cube>
dsheets: with __iter__
<_habnabit>
dsheets, I'm not sure what you're trying to say, but you can certainly reimplement a for loop by accessing the same machinery that the for loop does transparently
<_habnabit>
`for x in y: z(x)` is syntax sugar for approximately `it = iter(y); while True: try: x = next(it);; except StopIteration: break;; z(x)`
<dsheets>
_habnabit: or insert other side effects inside of __iter__ called by the comprehension syntax
<companion_cube>
everyonemines: not so trivial for 'yield' generators
<companion_cube>
for which you just want a python interpreter in ocaml with some state :p
<_habnabit>
dsheets, also, re: your previous statement, the BDFL is sadly both going back on previous decisions he's made and delegating more of his veto responsibility
<_habnabit>
dsheets, just Guido saying 'no' doesn't mean anything anymore
<companion_cube>
wow, really?
<_habnabit>
python, currently, is directionless and lost
<dsheets>
_habnabit: oh? i haven't paid attention in awhile since he was breaking fp features
<dsheets>
does he work for Google?
<companion_cube>
there still is itertools and functools
<_habnabit>
2.7 is a nice solid release. any higher version isn't worth using.
<_habnabit>
it's kind of sad.
<dsheets>
3k is doa?
<_habnabit>
basically
<everyonemines>
So they're going to add "all the features" and nobody will be able to read other people's code?
<everyonemines>
And the codebase will grow indefinitely?
<_habnabit>
py3k was a nice idea in theory, but it wasn't implemented well and it caused more issues than it solved
<dsheets>
or they'll just migrate to Go or Dart
<_habnabit>
ha ha ha, dart
<everyonemines>
Go has a lot of problems actually.
<_habnabit>
but if you're talking about google, I guess, ..
<everyonemines>
It would have been better if google backed D.
<dsheets>
not saying it's a step up
<companion_cube>
it would have been interesting, if google had backed D
<dsheets>
i'm not sure google's language choice affects much of anything
<everyonemines>
I'm liking lua so far. Less than ocaml, but...
<everyonemines>
more than python
<_habnabit>
yes I'm hoping google become more and more irrelevant
<dsheets>
i'll drink to that
<companion_cube>
everyonemines: but lua lacks the libs of python
<everyonemines>
hmm?
<everyonemines>
which ones
<companion_cube>
all of them?
<_habnabit>
all of them
<_habnabit>
hahah
<everyonemines>
luarocks?
<dsheets>
ok back to debugging js_of_ocaml
<dsheets>
thanks for the lulz, everybody
<_habnabit>
also come on
<companion_cube>
i mean, in python, if you want to compress a file and send it through xmlrpc, it's like 5 lines
<_habnabit>
I can't take any language seriously that uses 1-based indexing
<companion_cube>
huhu
<everyonemines>
oh yeah
<dsheets>
matlab!
<_habnabit>
haven't you read dijkstra's essay
<everyonemines>
I agree that it's a mistake.
<_habnabit>
dsheets, :(
<dsheets>
mmm i love me some 1-indexed vectors
<everyonemines>
well, it's like ocaml having *.
<everyonemines>
in that it doesn't matter as much as it is visible
<everyonemines>
ocaml has a better reason for that, maybe I should say ;; instead
<everyonemines>
;;_;;
<everyonemines>
and ocaml has better syntax, but well
<everyonemines>
they're trying to be like c
<everyonemines>
Eh, all programming languages suck I guess.
<_habnabit>
in short, yes
<dsheets>
sk calculus is perfect
<dsheets>
just the facts
<companion_cube>
dsheets: no, it lacks libs.
<dsheets>
that's just because it's unloved not because the language is bad
<companion_cube>
^^
<everyonemines>
I should make an eclipse plugin for sk as a joke.
<everyonemines>
"Verbose? Just use an IDE."
<companion_cube>
try unlambda
<companion_cube>
but if you do it in eclipse, do a xml version of SK calculus
<everyonemines>
haha
<everyonemines>
brilliant
<dsheets>
just implement redexes as xslt transforms
<everyonemines>
Oh hey, it'll even run in the browser!
<everyonemines>
That's a killer feature.
Tobu has quit [Ping timeout: 272 seconds]
<dsheets>
hmm… i wonder what the combinators are for xslt redexes. composition in particular should have sublinear results
<MaskRay>
thank you for your fervor, i've scrawed my own string_to_list
<companion_cube>
everyonemines: oh, if you want to write a JS version, please do
<everyonemines>
no, a lot of browsers will automatically execute xslt
<companion_cube>
a fork of the language based on html
<companion_cube>
oh, cool
<MaskRay>
is there any counterpart of `show' in Haskell which takes any showable atomic data structure (string,int,float,..) or records whose members are all showable, and prints it in a human-readable way
<MaskRay>
my package manager Portage keeps all files under /usr/share/doc bzip2ed
<thelema>
ah, ok.
<yezariaely>
The deriving project introduces a deriving show in ocaml (https://github.com/jaked/deriving) However, the latest version won't compile. Anyone can reproduce it?
<yezariaely>
ah maybe I have a solution, gimme a second
<thelema>
yezariaely: it compiles fine for me.
<dsheets>
seems to build for me
<yezariaely>
It works now, I was missing camlp4-extra
<yezariaely>
thelema: thank you!
<yezariaely>
the error message was kind of weird...
<MaskRay>
yezariaely: library to show all showable atomic data structures and there derivative?
<yezariaely>
yes, seems like that
<yezariaely>
But I am still playing around
<yezariaely>
but, there seems to be more which I do not get at the moment
<MaskRay>
cool. i'm looking forward to it not long ago
<yezariaely>
serializing is possible, as well
<yezariaely>
Looks quite usefull
letrec_ has quit [Remote host closed the connection]
willb has joined #ocaml
zorun has quit [Read error: Connection reset by peer]
zorun has joined #ocaml
Tobu has joined #ocaml
ulfdoz has joined #ocaml
fraggle_ has quit [Remote host closed the connection]
<MaskRay>
yezariaely: this repo doesn't come with a `make install' ?
fraggle_ has joined #ocaml
iago has joined #ocaml
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ftrvxmtrx has quit [Ping timeout: 245 seconds]
<yezariaely>
MaskRay: unfortunately not
<yezariaely>
I was missing it, too
<yezariaely>
MaskRay: However, the Makefile in the test dir shows how to use the library
<MaskRay>
yezariaely: i think copying the `lib' directory is enough
metasyntax|work has joined #ocaml
<yezariaely>
sure
braibant has joined #ocaml
<f[x]>
there is also ocsigen fork and my deriving repo
<f[x]>
both have install targets
<f[x]>
ocsigen one is more featureful iirc
logicgeezer has joined #ocaml
<yezariaely>
f[x]: wow, ocsigen is a full blown web development system in ocaml?
braibant has left #ocaml []
<f[x]>
wow, you hear about it for the first time??
<yezariaely>
In fact, I do ;-)
braibant has joined #ocaml
<f[x]>
I heard some people even use it
letrec has joined #ocaml
<yezariaely>
f[x]: where can I find your deriving repo?
<f[x]>
repo.or.cz/w/deriving.git
<yezariaely>
ah, this is a fork to deriving
<yezariaely>
MaskRay: maybe this suits you better
<MaskRay>
i've alread made my homebrew ebuild to install it...
<thelema>
f[x]: hmm, odb can't auto-install your fork - it looks like it runs the old build system and then ocamlbuild, which complains because the old build system litters files everywhere
<thelema>
f[x]: mind moving the obuild target first in the makefile?
silver has quit [Remote host closed the connection]
<f[x]>
thelema, hm, indeed
<f[x]>
actually I have that change but not committed :)
<f[x]>
done (one year since the last commit, lol)
<thelema>
:)
cdidd has quit [Quit: Leaving]
letrec has quit [Ping timeout: 240 seconds]
Ptival has joined #ocaml
<Ptival>
I have now been waiting for 20 minutes for OMLet to indent my 700-lines function :D
<Ptival>
"150 lines to indent..."
<thelema>
blah. looks like a bad indenting algorithm
<Ptival>
it is particularly slow when indenting the n-th "|" of a variant declaration / a pattern match
<Ptival>
from about n = 50, it gets painful :)
<Ptival>
now why would you have so many cases?
<Ptival>
well... I do.
<thelema>
either fix your code or fix the indenter or don't use that indenter
<Ptival>
sure
<Ptival>
but... vimscript...
iago has quit [Read error: Operation timed out]
Submarine__ has joined #ocaml
Submarine__ is now known as Submarine
Submarine has quit [Changing host]
Submarine has joined #ocaml
MaskRay has quit [Quit: leaving]
pangoafk has quit [Ping timeout: 245 seconds]
edwin has quit [Ping timeout: 240 seconds]
pangoafk has joined #ocaml
Cyanure has quit [Ping timeout: 260 seconds]
<bnwr>
Ptival: maybe you can pipe your code into camlp4
<bnwr>
:help filter
ivan\ has quit [Ping timeout: 244 seconds]
edwin has joined #ocaml
Cyanure has joined #ocaml
ivan\ has joined #ocaml
Drup has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: Operation timed out]
ulfdoz_ is now known as ulfdoz
<adrien>
when implementing methods for objects, is there a way to implement them outside of the "object ... end" block?
<adrien>
actually, like it's done in C++
<adrien>
I'd like to avoid having huge blocks of code
<thelema>
adrien: inheritance?
<adrien>
I don't have inheritance here; I'm using objects only to encapsulate state
ppilatus has joined #ocaml
<ppilatus>
Hello. How can I create a binary type, that is, a type with two constructors: 0 and 1.
<ppilatus>
I know that I can just use `type Binary = a | b', but I was wondering if it is possible to do that with zeros and ones
<thelema>
type binary = Z | O
<thelema>
nope, can't use numbers as varinat constructors
<thelema>
*variant
<ppilatus>
I see, thanks.
mdelaney has joined #ocaml
mdelaney has quit [Read error: Operation timed out]
Cyanure has quit [Quit: Quitte]
othiym23 has joined #ocaml
Xizor has joined #ocaml
pangoafk is now known as pango
ivan\ has quit [*.net *.split]
rossberg_ has quit [*.net *.split]
ikaros has quit [*.net *.split]
<adrien>
CAMLprim value win_system(cmd) value cmd;