Skaterhaym has quit [Read error: Connection reset by peer]
Skaterhaym has joined #ocaml
toppler has joined #ocaml
bitwinery__ has joined #ocaml
Skaterhaym has quit [Ping timeout: 240 seconds]
traviss has joined #ocaml
toppler has quit [Ping timeout: 265 seconds]
bitwinery__ has quit [Read error: Connection reset by peer]
warriors has quit [Quit: Connection closed for inactivity]
bitwinery__ has joined #ocaml
toppler has joined #ocaml
spew has quit [Quit: Connection closed for inactivity]
toppler has quit [Ping timeout: 265 seconds]
olle has quit [Ping timeout: 268 seconds]
olle has joined #ocaml
toppler has joined #ocaml
toppler has quit [Ping timeout: 240 seconds]
toppler has joined #ocaml
toppler has quit [Ping timeout: 265 seconds]
toppler has joined #ocaml
toppler has quit [Ping timeout: 240 seconds]
mfp has quit [Ping timeout: 268 seconds]
toppler has joined #ocaml
bitwinery__ has quit [Quit: Leaving]
jerith has quit [Remote host closed the connection]
toppler has quit [Ping timeout: 240 seconds]
tormen has joined #ocaml
tormen_ has quit [Ping timeout: 265 seconds]
toppler has joined #ocaml
kai_ has joined #ocaml
toppler has quit [Ping timeout: 240 seconds]
toppler has joined #ocaml
kai_ has left #ocaml [#ocaml]
toppler has quit [Ping timeout: 240 seconds]
JeanMichel has joined #ocaml
toppler has joined #ocaml
JeanMichel has quit [Remote host closed the connection]
toppler has quit [Ping timeout: 240 seconds]
toppler has joined #ocaml
warriors has joined #ocaml
toppler has quit [Ping timeout: 276 seconds]
toppler has joined #ocaml
toppler has quit [Ping timeout: 265 seconds]
toppler has joined #ocaml
toppler has quit [Ping timeout: 276 seconds]
toppler has joined #ocaml
toppler has quit [Ping timeout: 265 seconds]
toppler has joined #ocaml
toppler has quit [Ping timeout: 246 seconds]
toppler has joined #ocaml
narimiran has joined #ocaml
toppler has quit [Ping timeout: 265 seconds]
gravicappa has joined #ocaml
toppler has joined #ocaml
unyu has quit [Ping timeout: 240 seconds]
toppler has quit [Ping timeout: 240 seconds]
toppler has joined #ocaml
toppler has quit [Ping timeout: 250 seconds]
toppler has joined #ocaml
toppler has quit [Ping timeout: 265 seconds]
toppler has joined #ocaml
toppler has quit [Ping timeout: 240 seconds]
mbuf has joined #ocaml
toppler has joined #ocaml
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
toppler has quit [Ping timeout: 276 seconds]
Serpent7776 has joined #ocaml
toppler has joined #ocaml
unyu has joined #ocaml
toppler has quit [Ping timeout: 240 seconds]
barockobamo has joined #ocaml
toppler has joined #ocaml
ggole has joined #ocaml
freyr69 has joined #ocaml
brillenfux has joined #ocaml
toppler has quit [Ping timeout: 268 seconds]
bartholin has quit [Remote host closed the connection]
<adrien>
about my problem from a couple days ago, I was probably stuck because what I needed in practice was to hide fields from an object (and I was using objects because jsoo and JS APIs)
<adrien>
I finally switched to hidng the objects and provide functions instead of their methods
brillenfux has quit [Remote host closed the connection]
brillenfux has joined #ocaml
toppler has joined #ocaml
<adrien>
unfortunately I also had to put my two(!) low-level modules inside a module which only purpose is to have a restrictive signature
<adrien>
(and which I "include" right after its definition)
toppler has quit [Ping timeout: 265 seconds]
jaar has joined #ocaml
toppler has joined #ocaml
orbifx3 has joined #ocaml
warriors has quit [Quit: Connection closed for inactivity]
toppler has quit [Ping timeout: 268 seconds]
jaar has quit [Read error: Connection reset by peer]
orbifx3 has quit [Read error: Connection reset by peer]
orbifx3 has joined #ocaml
nicoo has quit [Ping timeout: 260 seconds]
andreas31 has quit [Ping timeout: 260 seconds]
klntsky has quit [Ping timeout: 260 seconds]
cartwright has quit [Ping timeout: 260 seconds]
<Leonidas>
needs to use uuseg though :D
toppler has quit [Ping timeout: 268 seconds]
_whitelogger has joined #ocaml
nullifidian_ has joined #ocaml
toppler has joined #ocaml
nullifidian has quit [Ping timeout: 265 seconds]
nicoo has joined #ocaml
klntsky has joined #ocaml
orbifx3 has quit [Read error: Connection reset by peer]
orbifx4 has joined #ocaml
toppler has quit [Ping timeout: 240 seconds]
toppler has joined #ocaml
toppler has quit [Ping timeout: 265 seconds]
toppler has joined #ocaml
Cypi_ is now known as Cypi
andreas31 has joined #ocaml
toppler has quit [Ping timeout: 268 seconds]
toppler has joined #ocaml
toppler has quit [Ping timeout: 268 seconds]
toppler has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
brillenfux has quit [Remote host closed the connection]
spew has joined #ocaml
toppler has quit [Ping timeout: 268 seconds]
nullifidian_ is now known as nullifidian
toppler has joined #ocaml
freyr69 has quit [Remote host closed the connection]
tane has joined #ocaml
Haudegen has joined #ocaml
warriors has joined #ocaml
toppler has quit [Ping timeout: 276 seconds]
malina has quit [Remote host closed the connection]
toppler has joined #ocaml
orbifx4 has quit [Read error: Connection reset by peer]
orbifx has joined #ocaml
infinity0 has quit [Ping timeout: 240 seconds]
infinity0 has joined #ocaml
toppler has quit [Ping timeout: 240 seconds]
orbifx has quit [Read error: Connection reset by peer]
orbifx has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
toppler has joined #ocaml
<cemerick>
I get the vague sense that angstrom is well-used in application contexts, but seems to be far less used in libraries.
toppler has quit [Ping timeout: 276 seconds]
<spew>
yeah I use it for a compiler
gareppa has joined #ocaml
<spew>
technically it's a library that implements all the passes of the compiler though
<cemerick>
it's really quite lovely, though I haven't done any benchmarking of it. I wonder if the bias is due to avoiding dependencies in libraries generally.
<companion_cube>
it seems like it's nice for parsing binary stuff
<companion_cube>
otherwise menhir is just perfect
toppler has joined #ocaml
<spew>
I like writing my parser in angstrom because it makes it easier to write the qcheck tests
<spew>
more like, I write the qcheck generator and more or less copy it to the parser and I'm done
<spew>
two birds with one monadic stone
<companion_cube>
:D
<cemerick>
I've felt that classic parser generators are a code smell for a long time now
<cemerick>
just like any code generation, tbh
<companion_cube>
meh
<companion_cube>
menhir is really great, hard to emulate with combinators
<cemerick>
ppx_menhir would be interesting
<companion_cube>
😱
<companion_cube>
(for me, it's ppx that are a code smell :p)
<cemerick>
you can take me out of a lisp, but can't take the lisp out of me
<companion_cube>
code generation is just another form of lisp macros ;)
<cemerick>
whoa there buddy lol
<Drup>
yeah, I really don't see the difference between codegen and metaprog here
<Drup>
but I mean, if a technology that allows you to actually do static analysis over your grammar is a code smell, sure, go forth
<Drup>
I'll stick to the stuff that ensures absence of ambiguity and the right complexity :3
<companion_cube>
to be fair, menhir isn't your average parser generator
<companion_cube>
it's a lot better
<companion_cube>
including error recovery
smazga has joined #ocaml
infinity0 has quit [Remote host closed the connection]
toppler has quit [Ping timeout: 268 seconds]
<Drup>
among many other things, yep :)
infinity0 has joined #ocaml
<cemerick>
good metaprogramming provides for a regularity of language at each level of abstraction and each stage of generation/expansion
<companion_cube>
otoh it's a little bit of overhead to write a parser+lexer
<companion_cube>
cemerick: so, with an untyped language at every level? 🙃
<companion_cube>
tbh I'm more interested by what Zig is doing on that front
<simpson>
companion_cube: I think that those are all the hard parts of compilers, really. What else is there?
<Drup>
cemerick: only if you need such regularity. There are (many) cases where you want a different language, because the usecase is different
<Drup>
(like, you know, describing grammars)
<companion_cube>
simpson: type checking, code generation, optims? :p
<Drup>
simpson: that's actually the simplest part of writing a compiler ...
<simpson>
There's actually a reason why the untyped code-languages show up in every IR; it's because we gotta preserve the underlying *Turing category*. I'm still wrapping my head around this myself.
mfp has quit [Ping timeout: 240 seconds]
<Drup>
(and the least interesting one, in many regards)
<companion_cube>
it used to be the hard part, but well
<cemerick>
Drup: I should have said, the _option_ of regularity. ofc the whole point of metaprogramming is to provide language-oriented abstractions
<companion_cube>
even writing a parser by hand isn't that hard if the grammar is not crazy
<Drup>
companion_cube: it was the hardest part when all we were compiling were Fortran and Lisp :D
<simpson>
Drup: If I had to summarize what I've learned about writing a compiler, I'd say that people don't often enough talk about how hard the *runtime* is to write!
<companion_cube>
Drup: and C, and modula, and pascal, and algol?
gareppa has quit [Quit: Leaving]
<Drup>
that was later, and a bit harder
malina has joined #ocaml
<Drup>
(C and modula, notably)
<companion_cube>
(also, kind of doubt that the parser is the hardest part of a lisp compiler ;))
toppler has joined #ocaml
<Drup>
well, the rest is really trivial too :p
<companion_cube>
errrrr
<companion_cube>
trivial, as in no one else still does it to this day?
<companion_cube>
(aka: where's my ocamlnat?)
<Drup>
s/compiler/standard mean of code exec/ (so, a REPL for lisp)
<companion_cube>
same thing
<companion_cube>
how many languages have a full native compiler inside their repl, really?
<Drup>
that's not the point ... at the time, the only thing provided was a REPL, and even if parsing Lisp is easy, the rest of the system (the Lisp REPL) was equally easy to write *AT THE TIME*
<cemerick>
companion_cube: native lisp compilers with relevant controls at the REPL are the subject of ~intermediate CS classes *shrug*
<cemerick>
so, lots, I guess?
<Drup>
parsing used to be a big thing at the time, because it was a big part of the complexity of a compiler/interpreter at that time
<Drup>
now, everything except parsing has become much more complicated, and most of the parsing has been figured out.
<companion_cube>
cemerick: really? hmmmm
<companion_cube>
Drup: I still disagree, native lisp compilers have existed for a while, and it's clearly non trivial since it's one of the only dynamic languages to have that
<companion_cube>
and to have had that for a while, too
<cemerick>
also all the various nanopass stuff coming out of IU, etc
<companion_cube>
ah, yeah, but I meant more the incremental compilation in the repl
<Drup>
yeah, but almost nobody does that because it has very little uses :)
<simpson>
Honestly, I feel like the next frontier is finding ways to replicate the chimeric nature of systems like Racket, where languages themselves are modular.
<simpson>
We have all of the tools required to *build* those systems, but not really to *generate* them. Like having Django but not Swagger/OpenAPI.
<cemerick>
companion_cube: there's nothing complicated about that; once you have the native compiler and a REPL, it's just a matter of your runtime's calling conventions and how you set up environments
<companion_cube>
Drup: yeah, who would want a native repl, really
<companion_cube>
…
<cemerick>
Drup with the masterful trolling lol
<Drup>
companion_cube: people who already have decent debuggers :D
<cemerick>
"seriously, I love restarting utop all the time"
<Drup>
who don't*
Serpent7776 has quit [Quit: Leaving]
<Drup>
C, C++ and Java programmers live without REPLs just fine :)
toppler has quit [Ping timeout: 240 seconds]
<Drup>
cemerick: ccube is so easy to troll, especially when he assumes everyone somehow does interactive theorem proving :D
<cemerick>
survival isn't a good metric IMO; but also, Java devs _would_ actually die without incremental code loading during debug sessions
orbifx has quit [Ping timeout: 268 seconds]
<companion_cube>
Drup: so, us?
<Drup>
you*
<Drup>
I don't.
<companion_cube>
I mean, if it's so trivial, I want ocamlnat, thank you
<companion_cube>
you don't use the repl?
<Drup>
not very often
<companion_cube>
it's so useful when you first learn the language :/
<cemerick>
this is exactly analogous to people who use/like laissez-faire dynlangs saying how they don't want/don't see the use of types
<Drup>
cemerick: it's actually kinda my point
<Drup>
the ocaml toplevel is not good enough for me to use it all the time
<cemerick>
that's exceedingly fair
<companion_cube>
so basically, "I don't need it because it sucks"
<companion_cube>
like with debugguers indeed
<Drup>
but what I would be looking for is *not* native compilation, not by far
<companion_cube>
what would be missing then? breakpoints?
bartholin has joined #ocaml
<cemerick>
just in-place loading of new fun definitions and additive type changes would be _huge_
<cemerick>
actually exactly what JVMs can reload/update safely
toppler has joined #ocaml
gareppa has joined #ocaml
<Drup>
in-place (re)loading, definitely
<Drup>
but also breakpoint+local code edition, like you can do in ruby for instance. That's super difficult to do in non-interpreted languages like ocaml, though
<companion_cube>
reloading, like with use?
<Drup>
not necessarely
<companion_cube>
breakpoints are hard indeed
<Drup>
you do `dune utop`, you type some code in, you change the project, you recompile (or it recompiles itself through dune watch) and automatically reload the toplevel, so you can keep trying things
olle has quit [Ping timeout: 276 seconds]
olle has joined #ocaml
toppler has quit [Ping timeout: 265 seconds]
gareppa has quit [Quit: Leaving]
<ggole>
You can absolutely have compilation and redefinition, but you kinda need the language to play nice
infinity0_ has joined #ocaml
infinity0_ has quit [Changing host]
infinity0_ has joined #ocaml
infinity0 has quit [Ping timeout: 268 seconds]
toppler has joined #ocaml
<ggole>
And I could not agree more about the toplevel (although I use it fairly often)
narimiran has quit [Ping timeout: 240 seconds]
<companion_cube>
if `use` could pull things recursively, it'd help a lot imho
<companion_cube>
but yeah, at work we have our own system anyway (and it's somewhat more dynamic than vanilla OCaml)
AtumT has joined #ocaml
toppler has quit [Ping timeout: 240 seconds]
gareppa has joined #ocaml
barockobamo has quit [Remote host closed the connection]
<mbuf>
Why isn't there command line history in the ocaml interpreter prompt? I always have to re-type commands from scratch.
<companion_cube>
because you should use utop :D
<mbuf>
Usually, using up and down arrow keys, one can scroll through the previous commands
<def`>
or down
<companion_cube>
(or something similar)
<def`>
or rlwrap, etc.
<companion_cube>
we have a linenoise based thing at work
<mbuf>
utop can run in Emacs, nice! will check it out; thanks!
toppler has joined #ocaml
jbrown has quit [Ping timeout: 276 seconds]
ziyourenxiang_ has quit [Ping timeout: 276 seconds]
toppler has quit [Ping timeout: 240 seconds]
Serpent7776 has joined #ocaml
toppler has joined #ocaml
ollehar has quit [Ping timeout: 240 seconds]
toppler has quit [Ping timeout: 268 seconds]
malina has quit [Remote host closed the connection]
mbuf has quit [Quit: Leaving]
toppler has joined #ocaml
<ggole>
If you're in emacs, the standard toplevel should have history too
orbifx has joined #ocaml
toppler has quit [Ping timeout: 265 seconds]
toppler has joined #ocaml
_y has joined #ocaml
<_y>
how safe is it to assume that Stdlib.compare returns precisely { -1 ; 0 ; +1 } ?
toppler has quit [Ping timeout: 250 seconds]
<_y>
the spec only says that it returns a value less, equal or greater than 0, but when looking at the source code there is effort put specially so that the function only returns canonical values: https://github.com/ocaml/ocaml/blob/trunk/runtime/compare.c#L298
<companion_cube>
not very safe
gareppa has quit [Quit: Leaving]
<ggole>
compare can call custom C code, which can do anything that's within the rules
<ggole>
Such as returning other values.
<ggole>
So you can get into trouble even without considering possible changes in the implementation
<_y>
ggole, but with the C code i linked, if `caml_compare` is the entry point for Stdlib.compare, then whatever C callbacks do, the result will be normalized at the end
<_y>
or i am mistaken?
toppler has joined #ocaml
<ggole>
Oh, hmm.
<ggole>
You seem to be right. I still wouldn't rely on it, though.
toppler has quit [Ping timeout: 264 seconds]
Haudegen has quit [Quit: Bin weg.]
toppler has joined #ocaml
orbifx has quit [Ping timeout: 240 seconds]
nullifidian has quit [Read error: Connection reset by peer]
nullifidian has joined #ocaml
toppler has quit [Ping timeout: 240 seconds]
toppler has joined #ocaml
toppler has quit [Ping timeout: 265 seconds]
jim7j1ajh has joined #ocaml
toppler has joined #ocaml
jimt has quit [Ping timeout: 265 seconds]
jbrown has joined #ocaml
toppler has quit [Ping timeout: 246 seconds]
<sim642>
Is there anything to inline open-s? I'd like to locally keep my code properly organized into files but be able to quickly get a single file for submitting to hackerrank for example
malina has joined #ocaml
toppler has joined #ocaml
mfp has joined #ocaml
jaar_ has quit [Ping timeout: 250 seconds]
toppler has quit [Ping timeout: 245 seconds]
toppler has joined #ocaml
malina has quit [Remote host closed the connection]
ggole has quit [Quit: Leaving]
nicoo has quit [Ping timeout: 260 seconds]
toppler has quit [Ping timeout: 265 seconds]
nicoo has joined #ocaml
toppler has joined #ocaml
olle has quit [Ping timeout: 240 seconds]
olle has joined #ocaml
AtumT has quit [Ping timeout: 240 seconds]
AtumT has joined #ocaml
toppler has quit [Ping timeout: 265 seconds]
bitwinery has joined #ocaml
bitwinery has quit [Remote host closed the connection]
bitwinery has joined #ocaml
tane has quit [Quit: Leaving]
toppler has joined #ocaml
kakadu_ has joined #ocaml
narimiran has joined #ocaml
toppler has quit [Ping timeout: 240 seconds]
gravicappa has quit [Ping timeout: 268 seconds]
toppler has joined #ocaml
sophiag has joined #ocaml
narimiran has quit [Remote host closed the connection]
<sophiag>
i'm having trouble linking a static library to an executable in dune. i usually use c_library_flags when using libraries and the docs state this can also be used in executable stanzas, but it appears not. any help? fyi, i'm on dune 1.0 so some of the field names have changed
toppler has quit [Ping timeout: 265 seconds]
toppler has joined #ocaml
jbrown has quit [Ping timeout: 246 seconds]
jbrown has joined #ocaml
vicfred has quit [Quit: Leaving]
toppler has quit [Ping timeout: 240 seconds]
Serpent7776 has quit [Quit: leaving]
toppler has joined #ocaml
jao has joined #ocaml
troydm has quit [Ping timeout: 276 seconds]
toppler has quit [Ping timeout: 265 seconds]
toppler has joined #ocaml
toppler has quit [Ping timeout: 265 seconds]
toppler has joined #ocaml
toppler has quit [Ping timeout: 268 seconds]
toppler has joined #ocaml
toppler has quit [Ping timeout: 250 seconds]
spew has quit [Quit: Connection closed for inactivity]
toppler has joined #ocaml
kakadu_ has quit [Remote host closed the connection]