adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.06.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.06/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
<dogui> Is there any equivalent to C's #line for OCaml? i.e. something that modifies the values of __LINE__ and __FILE__
<steenuil> oh you want to modify it
<steenuil> I guess you could do it with a ppx
pierpal has joined #ocaml
<dogui> I guess there's nothing already canned then :)
mk9 has quit [Quit: mk9]
silver_ has joined #ocaml
silver has quit [Ping timeout: 240 seconds]
pierpal has quit [Ping timeout: 240 seconds]
baboum has quit [Quit: WeeChat 2.1]
<steenuil> not that I know of, but maybe I'm not the best person to ask
unyu has quit [Quit: reboot]
shinnya has joined #ocaml
unyu has joined #ocaml
snhmib has quit [Ping timeout: 245 seconds]
snhmib has joined #ocaml
larhat has quit [Quit: Leaving.]
<Drup> dogui: #line directives are accepted
snhmib has quit [Ping timeout: 245 seconds]
hdon has quit [Ping timeout: 245 seconds]
snhmib has joined #ocaml
malina has quit [Quit: Throwing apples of Montserrat]
silver_ has quit [Read error: Connection reset by peer]
<dogui> Drup: huh interesting, do you have an example of it? My attempts are failing to compile
snhmib has quit [Quit: WeeChat 1.6]
campesino has quit [Remote host closed the connection]
<Drup> The code generated by menhir is full of them
<Drup> it's documented somewhere in the manual as well
pyx has joined #ocaml
pyx has quit [Client Quit]
tormen has joined #ocaml
tormen_ has quit [Ping timeout: 245 seconds]
zolk3ri has quit [Remote host closed the connection]
pierpa has quit [Quit: Page closed]
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 260 seconds]
pierpal has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
pierpal has quit [Client Quit]
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 256 seconds]
hdon has joined #ocaml
hdon has quit [Ping timeout: 260 seconds]
pierpal has joined #ocaml
keep_away is now known as keep_learning
hdon has joined #ocaml
hdon has quit [Ping timeout: 252 seconds]
pierpal has quit [Ping timeout: 245 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
shw has quit [Quit: shw]
shw has joined #ocaml
neatonk has joined #ocaml
shinnya has quit [Ping timeout: 264 seconds]
neatonk has quit [Ping timeout: 245 seconds]
pierpal has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
pierpal has quit [Ping timeout: 248 seconds]
hdon has joined #ocaml
hdon has quit [Ping timeout: 260 seconds]
shinnya has joined #ocaml
tarptaeya has joined #ocaml
JimmyRcom_ has quit [Ping timeout: 260 seconds]
al-damiri has quit [Quit: Connection closed for inactivity]
slash^ has joined #ocaml
argent_smith has joined #ocaml
tarptaeya has quit [Ping timeout: 260 seconds]
tarptaeya has joined #ocaml
_berke_ has quit [Remote host closed the connection]
muelleme has joined #ocaml
muelleme has quit [Ping timeout: 245 seconds]
hdon has joined #ocaml
hdon has quit [Ping timeout: 252 seconds]
argent_smith has quit [Quit: Leaving.]
mk9 has joined #ocaml
kakadu has joined #ocaml
jnavila has joined #ocaml
veSirCmpwn has joined #ocaml
veSirCmpwn has quit [Remote host closed the connection]
sveit has quit [Ping timeout: 268 seconds]
sveit has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
larhat has joined #ocaml
Haudegen has joined #ocaml
pierpal has joined #ocaml
mbuf has joined #ocaml
pierpal has quit [Ping timeout: 252 seconds]
zozozo has quit [Ping timeout: 265 seconds]
pierpal has joined #ocaml
jnavila has joined #ocaml
jnavila has quit [Ping timeout: 256 seconds]
pierpal has quit [Ping timeout: 252 seconds]
hdon has joined #ocaml
hdon has quit [Ping timeout: 264 seconds]
zolk3ri has joined #ocaml
larhat has quit [Quit: Leaving.]
pierpal has joined #ocaml
exarkun has quit [Read error: Connection reset by peer]
pierpal has quit [Ping timeout: 256 seconds]
exarkun has joined #ocaml
<discord2> <Perry> BTW, looking at "lexical conventions", it seems like it still follows the Latin-1 charset even though that is deprecated. Perhaps at some point it should be official that the character set is UTF-8?
mk9 has quit [Read error: Connection reset by peer]
<discord2> <Perry> I recognize this would involve significant changes to the lexer. 😃
mk9 has joined #ocaml
jnavila has joined #ocaml
neatonk has joined #ocaml
jjmeyer0 has quit [Ping timeout: 240 seconds]
jnavila has quit [Ping timeout: 240 seconds]
averell has quit [Quit: .]
FreeBirdLjj has quit [Remote host closed the connection]
averell has joined #ocaml
FreeBirdLjj has joined #ocaml
<flux[m]> there should be a switch to support latin1, even though conversion is simple. probably support for latin1 would be best implemented with on-the-fly transcoding :)
jjmeyer0 has joined #ocaml
<hannes> if I want to pass an OCaml string to a C function, I can use the String_val macro, but is that sufficient (i.e.: do I need to copy the OCaml string to the C heap to avoid the OCaml GC moving that string around?)
<flux[m]> yes you do, if you want to hold on to it after returning or releasing the gc lock
<flux[m]> possible alternative to consider - if applicable - is Bigarray, where the data is not stored in OCaml heap (one of its purposes is C interoperability)
<hannes> flux[m]: thanks, yes, I'm aware of bigarray. I was mainly curious whether/why there's some C stubs here and there which don't caml_copy_string and their safety (and I failed to find information about this in the manual / on the internet)
<flux[m]> well to me it seems highly likely there are broken C stubs around :)
<flux[m]> in fact to me it seems it's sometimes a bit too tricky to get everything right if the interface is passing more complicated objects with non-trivial lifetimes..
hdon has joined #ocaml
<hannes> flux[m]: ic. now I wonder whether there could be a static analysis thereof.
<flux[m]> there was a tool but it, well, expired. I don't recall its name at the moment though.
<flux[m]> maybe nowadays it would be easier to build, with clang and other tool enhancements
<hannes> flux[m]: if you recall its name, i'd be interested
<flux[m]> maybe someone else can remember it :)
hdon has quit [Ping timeout: 264 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
pierpal has joined #ocaml
pierpal has quit [Client Quit]
FreeBirdLjj has joined #ocaml
pierpal has joined #ocaml
jjmeyer0 has quit [Ping timeout: 252 seconds]
pierpal has quit [Read error: Connection reset by peer]
larhat has joined #ocaml
hdon has joined #ocaml
hdon has quit [Ping timeout: 268 seconds]
<discord2> <Perry> flux[m]: I don't know that a latin1 flag is that useful, given that converting a file in latin1 into a file in utf8 is a single call to the uconv(1) command. That said, if such a change is made, documenting that uconv command (which is a bit irritating to write out) would be good!
<discord2> <Perry> (or iconv or what have you, there are several options.)
<discord2> <Perry> actually, I suppose since iconv is POSIX it's the better command to list.
<discord2> <Perry> "iconv -f ISO-8859-1 -t UTF-8"
pierpal has joined #ocaml
mk9 has quit [Quit: mk9]
shinnya has quit [Ping timeout: 240 seconds]
shinnya has joined #ocaml
JimmyRcom_ has joined #ocaml
jnavila has joined #ocaml
mbuf has quit [Quit: Leaving]
sajuuk1 has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
mk9 has joined #ocaml
sajuuk1 has quit [Quit: WeeChat 1.9.1]
sajuuk1 has joined #ocaml
mk9 has quit [Quit: mk9]
sh0t has joined #ocaml
pierpal has joined #ocaml
lostman has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
mk9 has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
<companion_cube> why would anyone want to support latin1 again?
shinnya has quit [Ping timeout: 256 seconds]
sajuuk1 has quit [Ping timeout: 245 seconds]
muelleme has joined #ocaml
Haudegen has quit [Read error: Connection reset by peer]
muelleme has quit [Ping timeout: 268 seconds]
pierpal has joined #ocaml
<discord2> <Perry> Back compat for old programs. But I don't think it makes sense since conversion can be done so automatically.
FreeBirdLjj has quit [Remote host closed the connection]
sajuuk1 has joined #ocaml
pierpal has quit [Ping timeout: 252 seconds]
<companion_cube> old programs can use old versions of OCaml, can't they?
<discord2> <Perry> They can. And as I said, you can convert from latin1 to utf8 with "iconv -f ISO-8859-1 -t UTF-8"
<companion_cube> eh
<discord2> <Perry> So I'm looking at the OCaml lexer, and it is written it seems in ocamllex, so it would be necessary (I think?) to update ocamllex to grok UTF-8 at some point if one wanted to support utf-8 officially at more than a trivial level. However, the nature of utf-8 is such that if one only wants to support unicode in comments and strings (not in chars!), it's more or less already possible.
<companion_cube> it's already possible
<companion_cube> my OCaml files are utf8, but identifiers are just ASCII
<discord2> <Perry> yes, as I said.
<companion_cube> there is no "more or less" :-)
<discord2> <Perry> Well, the "more or less" is that if it isn't official, an editor doesn't know what charset to expect .ml files to be in.
<discord2> <Perry> If it is official, you can tell Tuareg mode etc. to always presume a utf-8 encoding.
<discord2> <Perry> The step past that, of course, would be to allow things like `let π = 3.1415926" or what have you.
<discord2> <Perry> er "let π = 3.1415926"
<companion_cube> that's probably a bad idea
<companion_cube> it's a long debate anyway, but personally I'm happy with ascii for identifiers
<discord2> <Perry> I tend to agree that for identifiers there are few good reason to want it. That said, it would not be unpleasant to have a few more Unicode operators.
FreeBirdLjj has joined #ocaml
<companion_cube> such as?
<discord2> <Perry> Oh, like ∩ or ∘
<discord2> <Perry> or ∈ etc.
<discord2> <Perry> There's a lot of nice math symbols. But it's a frill.
<discord2> <Perry> It's not really necessary.
<companion_cube> yeah, and it opens the door to a lot of abuse
<steenuil> the problem with those is that it's hard to type them on most computers
<discord2> <Perry> steenuil: it's pretty easy in emacs.
<steenuil> you have to set up emacs to do that though
<discord2> <Perry> You have to set up emacs to edit ocaml, too. 😃
<discord2> <Perry> Much more important: standard library unicode string stuff.
<discord2> <Perry> Medium useful: support for Uchar constants.
<steenuil> that would be useful, yeah
<discord2> <Perry> Not very important: unicode operators. possibly not worth it at all: unicode identifiers.
<discord2> <Perry> very very useful: officially saying the charset is utf8 so editors know that's the charset to display.
<discord2> <Perry> (for comments, strings, etc.)
<steenuil> the only reason I can think of for wanting unicode identifiers is if your codebase is completely in a language other than english, probably
<discord2> <Perry> but that makes it really hard for anyone else to maintain.
<companion_cube> saying the strings are utf8 would definitely be a plus, yes
spew has joined #ocaml
<discord2> <Perry> I wonder if I shouldn't just submit a pull request for the manual to this effect.
<discord2> <Perry> I'll do it right now.
ctrlsbstr has joined #ocaml
zozozo has joined #ocaml
freusque has joined #ocaml
pierpal has joined #ocaml
pierpal has quit [Client Quit]
pierpal has joined #ocaml
spew has quit [Ping timeout: 240 seconds]
ziyourenxiang has quit [Ping timeout: 252 seconds]
mfp has joined #ocaml
caltelt has quit [Ping timeout: 248 seconds]
caltelt has joined #ocaml
pierpal has quit [Ping timeout: 240 seconds]
<discord2> <Perry> Okay, I've changed the lexer to no longer accept latin-1 in identifiers (which has been a warning for many years anyway) and the documentation to say the character set is latin-1. I'll do a pull request if it all builds right.
muelleme has joined #ocaml
<companion_cube> ✔
<discord2> <Perry> pardon, the documentation to say the character set is UTF-8.
ctrlsbstr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
larhat has quit [Quit: Leaving.]
ctrlsbstr has joined #ocaml
muelleme has quit [Ping timeout: 268 seconds]
slash^ has quit [Quit: Leaving]
larhat has joined #ocaml
Guest96535 has joined #ocaml
sajuuk1 has quit [Ping timeout: 252 seconds]
Guest96535 is now known as Haudegen
ctrlsbstr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ctrlsbstr has joined #ocaml
ctrlsbstr has quit [Client Quit]
ctrlsbstr has joined #ocaml
dtornabene has joined #ocaml
<Drup> Perry: You can consider that nothing is candidate for 4.07 at this point. I'm not quite sure why it hasn't been released already
spew has joined #ocaml
<copy`> @perry It is unclear from the code, does this actually allow utf8 in comments and strings? If so, it should verify that only valid utf8 is allowed
JimmyRcom_ has quit [Quit: Leaving]
<Drup> copy`: utf8 in comments and strings has been allowed for many years
<Drup> (I doesn't check anything about it though, and that's perfectly fine)
<copy`> Oh, cool. TIL
larhat has quit [Quit: Leaving.]
<discord2> <Perry> Drup: I can change it in a few seconds to put the "changes" into the post-4.08 section. I'd like to know if my format for that stuff is correct of course.
<discord2> <Perry> Drup: Changed.
<discord2> <Perry> Er, I meant post-4.07 stuff.
<discord2> <Perry> section.
<discord2> <Perry> Blah. I'm not doing great with words this afternoon.
spew has quit [Ping timeout: 256 seconds]
sh0t has quit [Ping timeout: 256 seconds]
larhat has joined #ocaml
<discord2> <Perry> Drup (and everyone): comments on the pull request are solicited.
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
<Drup> it's more a political question than an engineering one, so you'll have to wait for someone in the core team
<Leonidas> Preparing popcorn
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
<Leonidas> I wonder how much code in OPAM triggers the latin-1 warning.
<Drup> that is fairly easy (if time-consuming) to test
<Drup> turn it into an error, then ask kit_ty_kate to make a run :p
<companion_cube> not much, I hope
<companion_cube> unlike the safe-string thing :D
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
larhat has quit [Quit: Leaving.]
<discord2> <Perry> I think it would be fine if you guys said this was a good idea even if you're not members of the core team. That way they will know the community likes the idea. Also, you can still tell me if I did something wrong.
larhat has joined #ocaml
<discord2> <Perry> The safe string thing kind of amazes me, because it's such an easy thing to fix but so many things are still broken. 😦
tarptaeya has quit [Quit: Konversation terminated!]
hdon has joined #ocaml
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
nahra has joined #ocaml
hdon has quit [Ping timeout: 252 seconds]
jack5638 has quit [Ping timeout: 245 seconds]
larhat has quit [Ping timeout: 260 seconds]
jack5638 has joined #ocaml
ctrlsbstr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
argent_smith has joined #ocaml
freusque has quit [Quit: WeeChat 2.0]
_etc has joined #ocaml
<discord2> <Perry> ...and someone got angry but in a non-specific way.
jack5638 has quit [Read error: Connection timed out]
jack5638 has joined #ocaml
<_etc> I'm trying to understand ocamlc a bit more. When you want to compile and link a .ml file to an executable you have to include the .cmo's of all its dependencies AND all its dependencies' dependencies, right? ocamldep seems to be able to look at a .ml file and generate a list of its immediate dependencies. How does one get ALL the dependencies of a .ml file? Or, equivalently, how does one get the dependencies
<_etc> of an already-compiled .cmo in order to link with it?
<Drup> _etc: people usually use ocamlfind for that
<Drup> Note that .cma are more or less bundles of .cmo
<_etc> Ahhh that's what I was missing, thank you!
<_etc> So one strategy is to first to use ocamldep to find the immediate dependencies, get their names, then ocamlfind query -recursive them, and then load all the resulting packages... does that sound right?
<Drup> No. OCaml build system always require users to provide the list of package dependencies
<Drup> ocamldep is usually used for *local* build orders between *modules*. It doesn't know about packages or any external
<_etc> Ah that makes sense - thanks!
pierpal has joined #ocaml
<discord2> <Perry> In many ways, the ocamlc/ocamlopt command lines are very much like their C compiler counterparts. ocamlfind is a nice way to avoid having to search for the exact file path for all the components, but it isn't doing anything particularly magical.
pierpal has quit [Quit: Poof]
_etc has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
isd has joined #ocaml
jnavila has quit [Remote host closed the connection]
pierpa has joined #ocaml
larhat has joined #ocaml
pierpal has quit [Ping timeout: 252 seconds]
spew has joined #ocaml
mk9 has quit [Ping timeout: 276 seconds]
<steenuil> it's kind of like pkg-config
spew has quit [Ping timeout: 240 seconds]
dtornabene has quit [Quit: Leaving]
Guest44951 has quit []
ELLIOTTCABLE has joined #ocaml
kakadu has quit [Remote host closed the connection]
hdon has joined #ocaml
hdon has quit [Ping timeout: 240 seconds]
<dogui> Drup: just got back, thanks! indeed that works. I was writing `#line <num>` instead of `#<num>`..
zlsyx has joined #ocaml
ctrlsbstr has joined #ocaml
ziyourenxiang has joined #ocaml
<neatonk> 777777777777777777777777777777777777ikybbbbbbbbbbbbbbbbbbn vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvbvvvvvvvvvvvvvvvvvvvvbbbbbbbbbnnnnnjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjh m ,h d¿'ææææ
<neatonk>
<companion_cube> neatonk: ?
FreeBirdLjj has joined #ocaml
<neatonk> 44a2.00a l, mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmkkkkkkkkkkkkkkk
<neatonk> 0
<neatonk> Sorry, that was my 2yr old :)
<zolk3ri> lol
neatonk has quit [Ping timeout: 264 seconds]
larhat has quit [Quit: Leaving.]
neatonk has joined #ocaml
jjmeyer0 has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 248 seconds]
Haudegen has quit [Remote host closed the connection]