<magistr>
algebras data types, pattern mathcing and tail call
<companion_cube>
yes
AlexRussia has quit [Read error: Connection reset by peer]
<magistr>
and closures, lambdas -> currying and partial aplly supports any high level language
domsj has joined #ocaml
<companion_cube>
I'm not sure whether your are trolling or not
whirm has quit [Ping timeout: 240 seconds]
<companion_cube>
closures and partial application is much easier and idiomatic in OCaml than in most mainstream languages
<magistr>
immutability? let x = 7;; let x = x + 6;; ok
<companion_cube>
yep, that's immutable
<companion_cube>
it's not the same x
<companion_cube>
let x = 7 ;; let f () = x ;; let x = 8 ;; assert (f () = 7) ;;
<ely-se>
Don't confuse mutation with shadowing.
whirm has joined #ocaml
lostman has joined #ocaml
kakadu has joined #ocaml
<mrvn>
Ocamls imperative features are simply syntactic suggar for the equivalent functional constructs.
<companion_cube>
not really, there is still the possibility of doing raw mutation
<mrvn>
I was thinking for and while
<mrvn>
and ;
<companion_cube>
right
contempt has quit [Ping timeout: 240 seconds]
ely-se has quit [Quit: leaving]
contempt has joined #ocaml
ely-se has joined #ocaml
<Leonidas>
mrvn: I wouldn't really say ; is un-functional. It is just a binary operator that discards the value of the first operand and returns the value of the second one.
toomuchtvrotsurb has quit [Remote host closed the connection]
<dmbaturin>
Leonidas: Well, as it only makes sense for side-effectful computations, it feels kinda un-functional.
yomimono has joined #ocaml
<mrvn>
Leonidas: expr1; expr2 is short for let _ = expr1 in expr2 with a warning if _ is not ()
<dmbaturin>
Leonidas: On a side note, I think one of the reasons point-free style is popular among people who like FP is that it _feels_ functional as hell. :)
wagle has quit [Remote host closed the connection]
ollehar has joined #ocaml
wagle has joined #ocaml
<Accidus>
Algebr, you were right --- inline records are implemented in the current trunk, i.e., 4.03.0+trunk
<ollehar>
what do you guys think about this: For my PHP project, I want to use as much as possible from the php.net codebase, which is in C. They use a union for all variables, where all arrays are represented as HashTable. I want to optimize this, of course, to be able to use different kinds of arrays. But how would I then use a function like var_dump? Should I transform my data-structures to php vanilla zend_value (as it's called) during
<ollehar>
runtime (expensive), or make wrappers to handle my own new cases?
manizzle has quit [Ping timeout: 264 seconds]
<magistr>
and lisp too awful - has mutable variables
<mrvn>
Accidus: but they are different than named records, no extra indirection, right?
dsheets has quit [Ping timeout: 246 seconds]
<Accidus>
I don't know --- what does 'extra indirection' mean?
jonludlam has joined #ocaml
<mrvn>
magistr: if you don't have mutables then you have to pass an ENV variable to every function and back all the time to keep global state. That is way worse than having mutables.
<mrvn>
Accidus: type r = { ... } type foo = Foo of r. then foo is a block with Foo tag and pointer to an r.
<mrvn>
while I hope type foo = Foo of { ... } is a single block with Foo tag and the record in it.
<dmbaturin>
ollehar: Hhm, do you want to interpret PHP? I thought you limit the scope to type checking.
<ollehar>
dmbaturin: yeah, but I'm trying out the possibility for an LLVM backend now.
<dmbaturin>
ollehar: Good question. Did you check what existing PHP subset compilers like hiphop do?
<ollehar>
dmbaturin: yes, HHVM actually reimplement everything :( for their bytecode stuff.
<ollehar>
not an option for me
<magistr>
mrvn, ok, i will be holds variables in shared memory
Bhavya has quit [Read error: Connection reset by peer]
Bhavya has joined #ocaml
<Accidus>
mrvn you mean w.r.t. memory allocation etc?
<Leonidas>
dmbaturin: I can reproduce, pointfree feels very functional :-)
domsj has quit [Ping timeout: 252 seconds]
<Leonidas>
magistr: my lisp does not have mutable variables.
<dmbaturin>
Leonidas: Clojure?
<magistr>
Leonidas, yes, u can don't use setf and setq protocol
<dmbaturin>
Or we are talking CL?
<Leonidas>
dmbaturin: Clojure :-)
<Leonidas>
also I think magistr is just trolling
<ollehar>
Wait, is a hashtable used as a list slower than a list, really?
<magistr>
and Common Lisp is ugly, it has awful documentation
<companion_cube>
ollehar: in what way do you use it as a list?
<companion_cube>
if you store stuff and then iter on it, it's fast
<magistr>
what a fuck HyperSpec i read it
<ollehar>
companion_cube: that's how PHP does it internally. array(1, 2, 3) is a hash table, so foreach ($arr as $element) will loop hashtable as a list.
<companion_cube>
I wouldn't trust PHP for any performance decision
<magistr>
u like php?
<ollehar>
companion_cube: maybe not... Just have to consider the trade-offs. :P
<magistr>
in php 4 function in stdlib may be return null, false or a string
<magistr>
wtf php
<dmbaturin>
In dynamically typed languages chimeric datastructrures that are doubly-linked lists, arrays, hashtables, and something else are quite common.
<magistr>
and then it need to a match types
<magistr>
typeof etc
<magistr>
is_string()
dsheets has joined #ocaml
AlexRussia has joined #ocaml
<magistr>
in dynamic typed language u must write many unit tests or verify it on coq, and get run-times errors :)
<ely-se>
magistr: you can use === to do type-strict comparison
<magistr>
ely-se, in what language?
<ely-se>
PHP
<magistr>
ely-se, ok, u expert on php?
<magistr>
ely-se, how to realize async IO in php?
<magistr>
and how it is works in eventloop
<ely-se>
no
<magistr>
ely-se, u recommended this language?
<magistr>
php is more difficult than ocaml
<mrvn>
magistr: I don't. I stay as far away from PHP as I can
<ely-se>
I recommend using PHP for all tasks that PHP is best suited for.
<ely-se>
I recommend using OCaml for all tasks that OCaml is best suited for.
<magistr>
mrvn, and i stay as far away from languages, thats need to know category theory, i don't understand how to apply it.
<magistr>
ely-se, and what PHP is best suite?
<mrvn>
never heard of that
<magistr>
ely-se, i chaged php on perl in own projects
toomuchtvrotsurb has joined #ocaml
<magistr>
realy, i not understood CT and how it make applies in haskell for example
ely-se has quit [Quit: leaving]
ely-se has joined #ocaml
<ely-se>
woo, I just upgraded from Linux 3 to Linux 4 :v
_andre has joined #ocaml
<magistr>
i don't use linux, freebsd only
<magistr>
and freebsd use me
<MasseR>
magistr: you don't really need to undertand category theory to use haskell. Many of the underlying idioms are based on mathematics, but outside of that, they are just nice design patterns
<ely-se>
you need to understand category theory to use category theory
<MasseR>
Not really. Take for example, functor, which is clearly a CT concept. All you need to understand is the type, 'fmap :: Functor f => (a -> b) -> f a -> f b'
grouzen has quit [Ping timeout: 256 seconds]
<ely-se>
Functors are are just morphisms in the category of categories, what's the problem?
<Drup>
ely-se: wrong functors ;)
toomuchtvrotsurb has quit [Ping timeout: 264 seconds]
<ely-se>
No, we were actually discussing these functors.
<ely-se>
Everybody knows that true functors are just callable objects.
GeorgeHahn has joined #ocaml
BitPuffin has joined #ocaml
octachron has joined #ocaml
ggole has joined #ocaml
toomuchtvrotsurb has joined #ocaml
<mrvn>
I never heard of category theory and can use functors just fine.
tennix has quit [Ping timeout: 264 seconds]
xificurC has quit [Ping timeout: 265 seconds]
<ely-se>
Which functors? There are at least three definitions of "functor" widely in use in software development.
sepp2k has joined #ocaml
<mrvn>
Gibt es etwas das udp ports ueber ssh forwarded?
<mrvn>
ups, i wanted to kill that line.
<mrvn>
ely-se: the functors ocaml has
<ely-se>
Jawohl!
<ely-se>
mrvn: AFAIK they're unrelated to category theory functors.
Haudegen has quit [Ping timeout: 255 seconds]
Bhavya has quit [Quit: Quit the channel]
zpe has joined #ocaml
Haudegen has joined #ocaml
igoroliveira has joined #ocaml
toomuchtvrotsurb has quit [Ping timeout: 250 seconds]
Haudegen has quit [Ping timeout: 250 seconds]
<def`>
ely-se: three?
<ely-se>
OCaml functors, Haskell functors and C++ functors.
<companion_cube>
gah, I don't want to look at terminfo :s
Haudegen has joined #ocaml
<ggole>
And prolog functors
<ggole>
(Although not really "widespread".)
siddharthv is now known as siddharthv_away
ollehar has quit [Ping timeout: 252 seconds]
<Drup>
Algebr, Accidus: In 4.03, not in 4.02.3
<Drup>
(for inline records)
AltGr has left #ocaml [#ocaml]
<ely-se>
LibreOffice takes so much time to install. I want to install OPAM first dammit
<dmbaturin>
What are C++ functors?
<ely-se>
In C++ something is called a functor if it can be called but isn't a function.
<dmbaturin>
Why would they call it a functor?
<ely-se>
No idea! :P
<def`>
Why would they do c++
<dmbaturin>
Functor is essentially a curse word it seems.
<Drup>
companion_cube: I agree on your appreciation of the curses libraries
<ely-se>
it's probably not worth implementing a shell anyway
<ely-se>
Z shell works fine.
tmtwd has quit [Ping timeout: 250 seconds]
<Drup>
I agree, and it has lots of plugins and ressources
<adrien>
ely-se: last change 2012
<adrien>
but when was the last change of VT100?
<companion_cube>
wtf is `Channel`
tmtwd has joined #ocaml
kushal has joined #ocaml
tennix has joined #ocaml
<ely-se>
it's where you are in right now
ollehar has quit [Ping timeout: 260 seconds]
<dmbaturin>
Drup: What does utop use for line editing?
<Drup>
zed
<Drup>
and some widget defined in lamdba-term
<dmbaturin>
I'm actually going to write a domain-specific shell in ocaml, so I'm going to need it.
<companion_cube>
domain specific?
<companion_cube>
oh well, good luck
tmtwd has quit [Ping timeout: 264 seconds]
<dmbaturin>
$ opam search luck
<dmbaturin>
No packages found.
<companion_cube>
type luck = Tough | Good
struktured has joined #ocaml
<dmbaturin>
let luck = assert false
<dmbaturin>
companion_cube: If you've ever seen JunOS (or IOS), the thing I'm going is in that style. Adapting an existing shell to do that is far worse than just making a new one, sadly.
<adrien>
you want to do something like IOS ?
<adrien>
you should barf on your keyboard and let it write asm through short-circuits
<adrien>
should match it well
<Accidus>
Drup, ta, found it :)
<dmbaturin>
adrien: IOS would be a bad example really, but more people seen it at some point than JunOS.
Accidus has quit [Quit: Off to Vancouver, the scenic route!]
marsam has joined #ocaml
<ely-se>
iOS
tmtwd has joined #ocaml
<dmbaturin>
ely-se: Well, the lowecase i iOS doesn't have any shell. :)
<dmbaturin>
Or it does but it hides it from the user.
struktured has quit [Ping timeout: 264 seconds]
MercurialAlchemi has joined #ocaml
Anarchos has joined #ocaml
ely-se has quit [Quit: leaving]
BitPuffin has quit [Disconnected by services]
itPuffinB has joined #ocaml
itPuffinB is now known as BitPuffin
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
Anarchos has joined #ocaml
struktured has joined #ocaml
thomasga has joined #ocaml
Drup has quit [Ping timeout: 258 seconds]
averell has quit [Ping timeout: 258 seconds]
Drup has joined #ocaml
Anarchos has quit [Ping timeout: 246 seconds]
slash^ has joined #ocaml
shinnya has joined #ocaml
Anarchos has joined #ocaml
tmtwd has quit [Ping timeout: 250 seconds]
tmtwd has joined #ocaml
native_killer has joined #ocaml
octachron has quit [Ping timeout: 250 seconds]
claudiuc has joined #ocaml
claudiuc_ has joined #ocaml
claudiuc has quit [Ping timeout: 250 seconds]
lordkryss has joined #ocaml
MrScout has joined #ocaml
ggole has quit []
Drup has quit [Ping timeout: 258 seconds]
Drup has joined #ocaml
badkins has joined #ocaml
native_killer_ has joined #ocaml
native_killer_ has quit [Max SendQ exceeded]
native_killer_ has joined #ocaml
native_killer_ has quit [Max SendQ exceeded]
native_killer has quit [Ping timeout: 255 seconds]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
govg has joined #ocaml
govg has quit [Client Quit]
govg has joined #ocaml
govg is now known as Guest51161
thomasga has quit [Quit: Leaving.]
Guest51161 has quit [Client Quit]
thomasga has joined #ocaml
govg_ has joined #ocaml
MrScout has quit [Ping timeout: 246 seconds]
darkf has quit [Quit: Leaving]
ely-se has joined #ocaml
<ely-se>
I want a statically typed shell language.
<companion_cube>
yes please
<ely-se>
Which tracks the existence of files, like lifetimes in Rust.