companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.2.0 released: https://ocaml.org/releases/5.2.0 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
Everything has quit [Quit: leaving]
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
Tuplanolla has quit [Ping timeout: 252 seconds]
f[x] has joined #ocaml
divya has joined #ocaml
<discocaml> <oijolisp_11693> Hello everybody, Im reading "ocaml from the very beggining" and also trying to read this book, but I found to mathematical.. so my question is this. Did you know a mathematics book that gives the math maturity to digest better the book of the screens, thanks in advanced 😄 or other programming/math book as this but more math easy maybeXD
<discocaml> <darrenldl> if you're focusing on picking up ocaml, then i think https://cs3110.github.io/textbook/cover.html is a nice choice
<discocaml> <darrenldl> ah you are already using ocaml from the beginning, nvm
<discocaml> <oijolisp_11693> yees I didnt see that book yet, but I think they said something about OOP course take it before that course in cornell school, but I never touch OOP
<dmoerner> i think that book does enough to teach the oop comparisons it makes. worst case, you can skim them or learn as you go
<discocaml> <darrenldl> @oijolisp_11693 so to clarify, your upcoming goal is to be able to digest the book shown by your screenshots?
<discocaml> <darrenldl> im just confused where oop fits into the picture
<dmoerner> i think the point is that that book is for a second semester course after already learning java. so at several points, especially in the discussion of modules and signatures, it draws many comparisons with java. but i don't know java well and found it perfectly clear
<discocaml> <darrenldl> ah gotcha, cheers
<discocaml> <oijolisp_11693> yees I never use java or a programming language with OPP.. So I will give a try, thankss for the encourage 😄
<discocaml> <oijolisp_11693> Yees will be cool, because that book of the screens and the "ocaml from the very beggining" are the most begginer ocaml books that I found, but they take a very different approach and I found interesting the mathematical approach of the book in the screens but I dont comprenhend very much all the math stuff
<discocaml> <darrenldl> my advice is both maths and programming are very hands on, so just start playing around with code, see what compiler says, what output you get
<discocaml> <darrenldl>
<discocaml> <darrenldl> after some experience with the code, you will have much less of a mental hurdle to reading the mathematical aspects of it
<discocaml> <darrenldl>
<discocaml> <darrenldl> if the book starts off with very mathematical definitions from the get go, then its probably for ocaml beginners, but not beginners of functional programming
<discocaml> <darrenldl> in my experience, students who try to just sit and read often get stuck much longer than students who just start throwing code into IDE and see what sticks
<discocaml> <darrenldl> and another advice that i think teachers unfortunately need to give these days: if you want to learn, dont use gpt/llm
<discocaml> <darrenldl>
<discocaml> <darrenldl> students who claim they are learning with "assistance" of gpt/llm often learned nothing, but these students also didnt care to learn to begin with to be fair
<discocaml> <oijolisp_11693> Ready for the next chapter 😄
<discocaml> <darrenldl> what about the tail recursive versions : v
<discocaml> <oijolisp_11693> got it, make sense that of not for functional programming.. Thank you for the advice.. and another question. I dont like very much the perl/bash syntax.. I was thinking to use nim or ocaml for this purpose, what do you think if I start playing with ocaml making little scripts to, could be a good language for this purpose too?
<discocaml> <oijolisp_11693> that screen was taken before that :v
<discocaml> <oijolisp_11693> got it, make sense that of not for functional programming.. Thank you for the advice.. and another question. I dont like very much the perl/bash syntax.. I was thinking to use nim or ocaml for this purpose, what do you think if I start playing with ocaml making little scripts too, could be a good language for this purpose too?
<discocaml> <darrenldl> re using ocaml as scripting: well it's a tradeoff - the initial development cost of compiled language is higher than scripting language (i cannot just edit a line and run again, compiled language generally not catered to "running a single file"), but long term performance and stability generally is better than scripting language
<discocaml> <darrenldl> my advice is when it becomes a cli utility where it's reaching into the territory where you need 100 lines of bash to do it, then yeah i'd start making it a proper program in nim or ocaml or whatever
<discocaml> <darrenldl> re capability: it is definitely fine to use ocaml for accomplishing what you'd otherwise do with bash, just to varying degree of ergonomics (i wrote a linux installer in ocaml once with fairly complex encryption setup and customisability, so it's definitely viable)
<discocaml> <darrenldl> ah hm, i think i'm too tired to read coherently: sorry i think i misunderstood what you wrote - yeah i think starting a small cli utility is a good learning project, that has been my go to option when learning new programming languages. it keeps you motivated and allow you to focus more on the part of CS that is likely closer to what you want to experiment with (otherwise you wouldn't be putting those features into your cli utility to begin
<discocaml> <oijolisp_11693> Thank youu very much to take the time for answer :D, and sorry for my bad english :v .. So I will start writting scripts too
<dh`> my recommendation would be: if what you're trying to do is a shell script thing, trying to do it with anything other than a shell will be horribly painful
<dh`> bash is, however, not the first shell you should reach for, whatever the linux world seems to think
<dh`> meanwhile, perl no longer has any domain where it's a reasonable choice, so by all means use something else
f[x] has quit [Remote host closed the connection]
f[x] has joined #ocaml
f[x] has quit [Remote host closed the connection]
<discocaml> <darrenldl> dh`: what shell do you use?
bartholin has joined #ocaml
bartholin has quit [Quit: Leaving]
pi3ce has quit [Read error: Connection reset by peer]
pi3ce has joined #ocaml
pi3ce has quit [Read error: Connection reset by peer]
pi3ce has joined #ocaml
Serpent7776 has joined #ocaml
mbuf has joined #ocaml
<discocaml> <alyxshang> Correct me if I'm wrong but wasn't the Rust compiler written in OCaml at first?
toastal has quit [Quit: Gateway shutdown]
<discocaml> <._null._> Yes it was
<discocaml> <dinosaure> OCaml is a good language if you want to write an interpreter/compiler really fast 🙂
grobe0ba has quit [Quit: ZNC 1.8.2 - https://znc.in]
grobe0ba has joined #ocaml
olle_ has joined #ocaml
olle_ has quit [Ping timeout: 265 seconds]
olle__ has joined #ocaml
Putonlalla has joined #ocaml
pi3ce has quit [Read error: Connection reset by peer]
pi3ce has joined #ocaml
olle__ has quit [Ping timeout: 260 seconds]
mbuf has quit [Ping timeout: 264 seconds]
rynite has joined #ocaml
<discocaml> <azur1s> yes
<discocaml> <azur1s> agree!!
olle_ has joined #ocaml
<discocaml> <deepspacejohn> Within dune projects, at least, it’s very easy to write “scripts” that you run with `dune exec`. I do that a lot to make helpers for tests or generating files etc.
<discocaml> <azur1s> although i miss `todo!()` 😅
<discocaml> <azur1s> i just do `failwith __LOC__` for now
<adrien> If I create first-class modules in a loop and use them for functors (first-class modules too), is everything going to be collected as expected?
<octachron> At runtime, modules and functors are records and functions
rynite has quit [Quit: WeeChat 4.4.1]
olle_ has quit [Ping timeout: 248 seconds]
olle__ has joined #ocaml
divya has quit [Read error: Connection reset by peer]
<discocaml> <._null._> People usually use `assert false`, since it also reports location information
<discocaml> <azur1s> oh, thats nice
<discocaml> <azur1s> sometimes i do `failwith __LOC__ ^ " " ^ ...` in match cases when im lazy to implement something for that cases for now
<discocaml> <azur1s> not sure if asserting would let me add some "reason" into it
f[x] has joined #ocaml
<discocaml> <._null._> Ok, assert false is not really for todos but more for impossible cases; in fact I'd use failwith "todo" for a todo, assuming it won't stay so long that I forget about it
<discocaml> <azur1s> ohh
<discocaml> <azur1s> i actually have unreachable cases as `failwith "unreachable"`
<discocaml> <azur1s> good to know that, thanks
<discocaml> <barconstruction> Is __LOC__ a ppx thing
<discocaml> <._null._> No, it's compiler magic
<discocaml> <._null._> (You could see it as a builtin ppx I guess)
<discocaml> <azur1s> yeah
<discocaml> <azur1s> so i know which lines i was too lazy to deal with 😅
<discocaml> <otini_> yeah it’s substituted directly by the lexer
pi3ce has quit [Read error: Connection reset by peer]
pi3ce has joined #ocaml
<discocaml> <barconstruction> I have never seen this page come up on Google when I searched "OCaml debugging". I would expect search engines to do a better job but I guess it's a cycle of more trafficked pages being promoted more heavily in the results.
<adrien> octachron: thanks! now I need to look elsewhere to find my issue (which takes hours to be visible of course)
<adrien> :D
andpg has joined #ocaml
olle__ has quit [Ping timeout: 260 seconds]
toastal has joined #ocaml
andpg has quit [Ping timeout: 255 seconds]
olle__ has joined #ocaml
andpg has joined #ocaml
olle__ has quit [Ping timeout: 252 seconds]
Anarchos has joined #ocaml
Haudegen has joined #ocaml
olle has joined #ocaml
bartholin has joined #ocaml
semarie has quit [Ping timeout: 252 seconds]
Haudegen has quit [Quit: Bin weg.]
Haudegen has joined #ocaml
troydm has joined #ocaml
olle has quit [Ping timeout: 255 seconds]
Haudegen has quit [Quit: Bin weg.]
dmoerner has quit [Ping timeout: 272 seconds]
bartholin has quit [Quit: Leaving]
rgrinberg has joined #ocaml
dmoerner has joined #ocaml
andpg1 has joined #ocaml
andpg has quit [Read error: Connection reset by peer]
andpg1 is now known as andpg
andpg has quit [Read error: Connection reset by peer]
zenmov has joined #ocaml
euphores has quit [Ping timeout: 252 seconds]
Everything has joined #ocaml
euphores has joined #ocaml
mange has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
zenmov has quit [Quit: leaving]
Serpent7776 has quit [Ping timeout: 245 seconds]
f[x] has quit [Remote host closed the connection]
zenmov_ has joined #ocaml
zenmov_ has quit [Changing host]
zenmov_ has joined #ocaml
Armael has quit [Ping timeout: 245 seconds]
Armael has joined #ocaml
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
Tuplanolla has joined #ocaml