nullifidian_ has quit [Read error: Connection reset by peer]
nullifidian_ has joined #ocaml
hlisp has joined #ocaml
hlisp has quit [Remote host closed the connection]
hlisp has joined #ocaml
amiloradovsky has quit [Ping timeout: 240 seconds]
hlisp has quit [Remote host closed the connection]
hlisp has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
hlisp has quit [Remote host closed the connection]
sagax has quit [Quit: Konversation terminated!]
hlisp has joined #ocaml
pigeonv has quit [Ping timeout: 272 seconds]
mfp has quit [Ping timeout: 272 seconds]
hlisp_ has joined #ocaml
hlisp has quit [Ping timeout: 256 seconds]
hlisp_ has quit [Remote host closed the connection]
Guest32803 has quit [Remote host closed the connection]
hlisp has joined #ocaml
jao has joined #ocaml
hlisp has quit [Ping timeout: 260 seconds]
hlisp has joined #ocaml
hlisp_ has joined #ocaml
hlisp has quit [Ping timeout: 240 seconds]
dborisog has joined #ocaml
jao has quit [Remote host closed the connection]
sstc has quit [Quit: WeeChat 2.8]
jao has joined #ocaml
hlisp_ has quit [Remote host closed the connection]
hlisp has joined #ocaml
jao has quit [Ping timeout: 272 seconds]
hlisp has quit [Ping timeout: 256 seconds]
narimiran has joined #ocaml
mbuf has joined #ocaml
hlisp has joined #ocaml
Serpent7776 has quit [Read error: Connection reset by peer]
hlisp has quit [Remote host closed the connection]
Serpent7776 has joined #ocaml
ferd has quit [Ping timeout: 256 seconds]
ferd has joined #ocaml
ferd has quit [Ping timeout: 256 seconds]
vicfred has quit [Quit: Leaving]
ferd has joined #ocaml
chripell has joined #ocaml
olle___ has joined #ocaml
<olle___>
about typed effects, why not copy the approach from F*?
amiloradovsky has joined #ocaml
hlisp has joined #ocaml
hlisp has quit [Ping timeout: 260 seconds]
tane has joined #ocaml
mfp has joined #ocaml
Anarchos has joined #ocaml
hlisp has joined #ocaml
hlisp has quit [Ping timeout: 256 seconds]
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
amiloradovsky has quit [Remote host closed the connection]
Anarchos has quit [Ping timeout: 264 seconds]
amiloradovsky has joined #ocaml
Anarchos has joined #ocaml
amiloradovsky has quit [Remote host closed the connection]
hlisp has joined #ocaml
amiloradovsky has joined #ocaml
hlisp has quit [Ping timeout: 272 seconds]
sagax has joined #ocaml
hlisp has joined #ocaml
pigeonv has joined #ocaml
hlisp has quit [Ping timeout: 260 seconds]
Ekho has quit [Quit: An alternate universe was just created where I didn't leave. But here, I left you. I'm sorry.]
jao has joined #ocaml
Ekho has joined #ocaml
hlisp has joined #ocaml
hlisp has quit [Ping timeout: 260 seconds]
Jesin has quit [Ping timeout: 260 seconds]
Haudegen has joined #ocaml
hlisp has joined #ocaml
hlisp has quit [Ping timeout: 246 seconds]
hlisp has joined #ocaml
hlisp has quit [Ping timeout: 258 seconds]
DarkAdi has joined #ocaml
zolk3ri has joined #ocaml
<companion_cube>
why not use F* instead?
hlisp has joined #ocaml
andreas303 has quit [Remote host closed the connection]
<simpson>
Because obviously all popular languages should copy all popular features from all other popular languages~
waleee-cl has joined #ocaml
<companion_cube>
all non popular languages should copy features from all non popular languages, you mean? :D
<simpson>
Hah, I think we're on the same track. Feature selection is a really hard part of design, because features grind against each other so harshly.
hlisp has quit [Ping timeout: 272 seconds]
<simpson>
olle___: OCaml puts I/O and mutability into its story for handling effects; what were you imagining seeing in OCaml?
<companion_cube>
I mean, effect systems would be great in OCaml
andreas303 has joined #ocaml
<companion_cube>
it's just that the path to get there would be… tough
<olle___>
iirc, it's already on the map?
<simpson>
Sure. And I don't mean to discourage experimentation, but I'm always interested in this sort of proposal. I've suggested various features from my language be copied into others, so it's not like I'm innocent of this.
<companion_cube>
yeah, with no time estimation
hlisp has joined #ocaml
<olle___>
and i assume the people already looked and different solutions and thought "that's not gonna work for us"?
<companion_cube>
well, you have unique retrocompatibility constraints, remember
<companion_cube>
you can't just break the system
<Armael>
F* is a language/proof assistant very different from ocaml
<companion_cube>
there's a paper on the plan
<companion_cube>
(towards effects in the type system)
<Armael>
it's like asking "why not just copy paste dependent types from coq"
<thizanne>
why not though!
<companion_cube>
why not?
<olle___>
i thought F* had mutability?
<companion_cube>
why not copy the best feature of Coq: `match … end`
<companion_cube>
(just sayin' :p)
<olle___>
companion_cube: ok, will find the paper
<Anarchos>
how to get an inlined record in a result clause of a match ? should i reconstruct the record ?
<olle___>
companion_cube: but you can break *some* things?
<olle___>
or will that cause a fork?
<companion_cube>
you can't break existing code
<Anarchos>
cause i get This form is not allowed as the type of the inlined record could escape
<olle___>
companion_cube: PHP does it?
<companion_cube>
does it now? 😱
<olle___>
ya
<companion_cube>
I mean, you can break just a bit if you move to ocaml 5
<olle___>
but they mark things as deprecated for a long time
<companion_cube>
but if you break every single line of existing code
<companion_cube>
you're just forking
* Anarchos
never understood what 'effects' stand for
<olle___>
obviously
<companion_cube>
I'm not talking libraries there, I'm talking about the language
<companion_cube>
that's quite different
<olle___>
me too
<companion_cube>
where do you mark language stuff "deprecated" ?
<olle___>
companion_cube: in the compiler? give out warnings
<simpson>
companion_cube: PHP 7 is doing the thing that Perl 6 backed down on and that Python 3 dragged out for over a decade.
<olle___>
"this will be deprecated in the next version"
<simpson>
(To give both context and also my opinion on that style of language versioning.)
<olle___>
PHP did not break much, just removed some weird syntax and dangerous functions
<companion_cube>
olle___: yeah and if you do effects by just following a paper… you break all code, not just "a few weird syntax"
<olle___>
ok :)
<olle___>
just saying, it's not black and white
<companion_cube>
it mosly is
<companion_cube>
ocaml breaks a tiny amount of code at some releases
<olle___>
which one?
<companion_cube>
(I got the "honor" to fall into one of these categories recently)
<companion_cube>
well, you can't have a value with a non principal type in a .ml anymore
<companion_cube>
like `let r = ref None`
<companion_cube>
without further use
<companion_cube>
the compiler will now refuse that
<olle___>
no, aha
<olle___>
oops
<olle___>
no "no"
<olle___>
only aha
<olle___>
and there was good reasoning behind this change?
<companion_cube>
it's a code smell, I guess, and the typechecker was being cleaned up
<companion_cube>
(I guess)
<companion_cube>
anyway, it was maybe a handful of occurrences across tens of thousands of lines
<olle___>
in which code-base? the compiler?
zolk3ri has quit [Remote host closed the connection]
<companion_cube>
changing the *arrow type* in a functional language is a lot more elaborate
<companion_cube>
in my code
<olle___>
kk
<companion_cube>
to be compatible
* Anarchos
just did a pull request on dypgen, for those interested
<olle___>
no free lunch :(
<olle___>
another question, if linear types kind of can be hacked into ocaml with some syntax extension, what about doing the same with effect types? could it be done with ppx or monad wrapping? maybe it just ends up being haskell in the end, then?
<olle___>
(i'm thinking of the light weight session types thingy)
<companion_cube>
I don't think linear types can be hacked via syntax tricks?
<olle___>
companion_cube: well, session types, then
<companion_cube>
why would you want what? :DD
<companion_cube>
ocaml is not erlang
<olle___>
companion_cube: i mean, it also works for enforcing protocols
<companion_cube>
olle___, in a more serious tone: ocaml has a good type system, mayb you shoudl try to live with it
<companion_cube>
none of the features you're talking about will make it into OCaml, at least not before several years
<companion_cube>
you can write good code in the current, existing, OCaml
raver has quit [Remote host closed the connection]
<companion_cube>
I mean sure, but I don't want to have lenses and monads everywhere
<companion_cube>
god, that seems absolutely atrocious
<olle___>
yeah, not so "lightweight" after all :d
* Anarchos
finds that gadt are already difficult to understand , so effects lenses and monads seem like a theorist heaven which is a hell to programmers ....
<olle___>
Anarchos: well, it's supposed to be abstracted away for the programmer, i guess
<flux1>
I'll be happy if the new effect system+multicore will bring monad-free concurrency (back) to ocaml 🙄
<companion_cube>
me too, but we can wait for a long time
<olle___>
flux1: back? why back?
<olle___>
so ocaml doesn't like monads, eh? :D
<flux1>
well, the Thread-module is not very popular in OCaml, not probably least for its performance and provided functionality
hlisp has quit [Remote host closed the connection]
<olle___>
ok, i didn't keep up
<flux1>
I don't think you can use green threads with native code?
<companion_cube>
there are no green threads
<companion_cube>
`Thread` is just posix threads
<simpson>
olle___: Monads as an API, monads as a structure for control flow, or do-notation?
hlisp has joined #ocaml
<olle___>
dunno
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
olle___ has quit [Ping timeout: 264 seconds]
HyperMonkey has joined #ocaml
<HyperMonkey>
hi. how do I just download packages with opam without installing them? equivalent of apt-get -d
hlisp has quit [Remote host closed the connection]
hlisp has joined #ocaml
hlisp has quit [Ping timeout: 260 seconds]
<prsafont[m]>
`opam source` may be what you're looking for (not sure what apt-get -d does), try `opam source --help`
<prsafont[m]>
not sure if `opam install --dry-run` downloads the packages, but it's worth a shot
mbuf has quit [Quit: Leaving]
Anarchos has joined #ocaml
Anarchos has quit [Remote host closed the connection]
webshinra_ has quit [Remote host closed the connection]
Haudegen has quit [Quit: Bin weg.]
webshinra has joined #ocaml
nullifidian__ has joined #ocaml
nullifidian_ has quit [Ping timeout: 272 seconds]
sstc has joined #ocaml
raver has joined #ocaml
Anarchos has joined #ocaml
<Anarchos>
why does opam add "opam list --installed --short --safe --color=never" to the vimrc file ? It slows a lot the starting time of vim
<pigeonv>
maybe you get sooner the invalid switch warning sooner?
<pigeonv>
(much sooner, such wow)
<Anarchos>
pigeonv i did'nt understand.
<pigeonv>
sometimes, you get a *lot* of errors when the switch isn't configured correctly
<Anarchos>
mine should be
_whitelogger has joined #ocaml
<pigeonv>
you get a warning when you run something as simple as opam switch
Haudegen has joined #ocaml
<Anarchos>
i am not sure it provides only a sooner warning. I guess this list is used to initialize things for merlin (like ocp-index, ocp-indent)
<pigeonv>
sorry, I don't use ocp-index...
Jesin has joined #ocaml
<Anarchos>
pigeonv me neither, but opam user-setup merlin added stuff about it in vimrc
<olle>
companion_cube: stdlib and compiler should have some style authority?
<dmbaturin>
They just got rid of internal use syntax. :)
<dmbaturin>
There used to be "revised" syntax only used inside the compiler, not supposed to be used anywhere else.
<companion_cube>
dmbaturin: the type changed in what direction?
<companion_cube>
it may have moved from ?eq to ~eq
<companion_cube>
which is mostly forward compatible
<dmbaturin>
companion_cube: Yeah, something in the labeled arguments has changed. I've set the dependency to >2.7 for now.
<companion_cube>
sorry, that's a kind of minor breakage we sometimes do :/
<dmbaturin>
Well, if that CI build didn't end up with 2.3 somehow, I'd never known.
<companion_cube>
this uniformisation of ?eq/~eq is on the 3.0 list of things to do
Anarchos has quit [Remote host closed the connection]
narimiran has quit [Quit: leaving]
<dmbaturin>
That problem seems to be in the ~key argument though.
<dmbaturin>
If someone is stuck with containers 2.3 though... they have bigger problems. :)
Anarchos has joined #ocaml
<companion_cube>
I mean, if you write code for 2.7, and then your CI goes back to 2.3, yeah, it's a problem
<dmbaturin>
olle: What's idiomatic is a really funny question actually. Old OCaml code is often "Pascal with ADTs", using imperative features left and right. These days it will give you odd looks.
<olle>
hm
<olle>
if php can have a code standard, why can't ocaml?
<dmbaturin>
If Go forces a specific brace formatting on users... why should anyone else? ;)
<olle>
i keep nagging my colleagues every day...
<olle>
maybe that big ocaml company has a standard :d
<olle>
jane street
sstc has quit [Quit: WeeChat 2.8]
<reynir>
maybe you can check what ocamlformat does
<dmbaturin>
I remember browsing the code of Maxima. It reads a bit like early modern english—understandable but foreign.
<reynir>
if you "need" some kind of authority anyway
<dmbaturin>
Common Lisp of course hasn't changed, the way people write did.
<companion_cube>
reynir: but ocamlformat is super configurable, so you still have tons of styles
Anarchos has joined #ocaml
<olle>
standard is important
<olle>
also, the case for ocaml as a business language won't work without it
<Armael>
but what do you want to standardize
<olle>
indentation, space, stuff that's now idiomatic like upper-case module sig etc
<dmbaturin>
Who cares?
<olle>
20:49 < olle> also, the case for ocaml as a business language won't work without it
<olle>
^
<dmbaturin>
You can invent a corporate style and enforce it with ocamlformat/ocp-indent if you feel like it.
<olle>
that's the opposite of what I want :)
<dmbaturin>
>the case for ocaml as a business language won't work without it
<dmbaturin>
Two letters: JS. :)
<olle>
that's different, JS is the only choice
<olle>
also, airbnb standard using eslint
<dmbaturin>
On the server side, there's plenty of choice.
<waleee-cl>
billions of styles
<Anarchos>
dmbaturin and by the way, never let a cool programming language go into business language : industry always messes up with nice scientific stuff....
<olle>
well, there's no lack of academic languages in this world :)
<waleee-cl>
olle: weren't you keen on monadic code earlier?
<olle>
yes?
<dmbaturin>
I've just realized that kit_ty_kate is probably supposed to read kitty_kate... the person who told me I'm slow two years ago was right.
<waleee-cl>
olle: seems a bit unproductive if you want to promote a standard
<olle>
waleee-cl: why?
<waleee-cl>
I'd hazard a guess that the wast majority of ocaml is non-monadic. Wouldn't monadic code then be non-standard?
<olle>
yes
<olle>
well, you can include in the standard also style for monadic code, but maybe it would be more volatile
<reynir>
dmbaturin :D
<companion_cube>
sadly things like lwt force you to use a lot of monadic code
<companion_cube>
(not lwt's fault per se)
<olle>
sadly?
<olle>
I used lwt many years ago. it worked, but i never understood what i did xD
DarkAdi has quit [Ping timeout: 260 seconds]
tane has quit [Quit: Leaving]
<Leonidas>
I found Lwt much easier to understand than Pythons async stuff
<Leonidas>
in Lwt everything is clearly defined what it is (though I might disagree with how it is defined), whereas in Python everthing is about anything else, depending what you input you get something else out
<companion_cube>
even with mypy? :)
<simpson>
async/await has well-known fundamental problems. Anything coroutine-shaped, which pauses execution and leaves behind stale frames that could be reactivated, is going to create that sort of confusion.
<Leonidas>
anything can be an awaitable if you just want it hard enough
<ebb>
#ocaml got philosophical real quick
<companion_cube>
simpson: why is it worse than continuation based things like Lwt?
<Leonidas>
> In this documentation the term “coroutine” can be used for two closely related concepts:
<Leonidas>
thanks for nothing
<simpson>
companion_cube: I think that I'd say that most of the same problems are in Lwt; the main difference is whether, to use the meme, "functions have colors".
<Leonidas>
not even the docs care about being exact
<kit_ty_kate>
dmbaturin: mh actually it's meant to be read both ways (with and without the separate ty)
<companion_cube>
simpson: yeah, well, the only alternative is effects (at least the runtime version, with fibers)
<Leonidas>
dmbaturin: well, in some years I will also probably understand your nick :-)
<simpson>
companion_cube: FWIW it would be possible, and perhaps is already done somewhere in the API, to give Lwt "turns" or "nurseries" or "structured concurrency" (three different communities independently discovered the same thing), which is just a way to put a barrier between I/O actions and the closures of each action.
<simpson>
For Lwt, the sanest option would be nurseries: Each promise would be spawned from a manager which can be waited upon. And maybe this is already a thing; I'm reading Lwt docs but haven't seen it yet.
<companion_cube>
how do you give "turns" if you don't have a monad to have yield points?
<simpson>
In modern language, I think the phrase is "communicating event loops"; there's multiple event loops, and each loop can be run to completion. This has obvious similarities to nurseries.
<simpson>
Each loop takes a "turn" of I/O without consulting the other loops first. If the loops are kept sufficiently far apart, then their turns can't interact with each other.
<simpson>
But also yes, every system I've analyzed in e.g. Python, Ruby, JS, has effectively had a class called "Promise" or "Deferred" or "Future" or etc. and they're definitely monads.
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
<companion_cube>
so it doesn't change anything
<simpson>
I think it has a subtle but important effect. To give a completely fabricated generic example, `let x = self.break_invariants () in let%lwt y = self.do_io x in let z = self.restore_invariants (x, y) in Lwt.return (x, y, z)`
<simpson>
It might be possible to observe `self`, an object, with broken invariants, I think? And that's what structured concurrency aims to prevent, more or less.
Anarchos has quit [Ping timeout: 260 seconds]
Hrundi_V_Bakshi has quit [Ping timeout: 260 seconds]
cheater has quit [Ping timeout: 264 seconds]
cheater has joined #ocaml
Haudegen has quit [Ping timeout: 272 seconds]
theblatte has quit [Ping timeout: 260 seconds]
peterbb has joined #ocaml
theblatte has joined #ocaml
hlisp has joined #ocaml
peterbb has quit [Quit: peterbb]
cheater has quit [Ping timeout: 260 seconds]
cheater has joined #ocaml
amiloradovsky has quit [Ping timeout: 244 seconds]