companion_cube changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.11 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.11/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
delysin has quit [Quit: WeeChat 3.0.1]
delysin has joined #ocaml
delysin has quit [Client Quit]
delysin has joined #ocaml
curtosis has joined #ocaml
_whitelogger has joined #ocaml
rock64 has quit [Ping timeout: 256 seconds]
rock64 has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
vicfred has quit [Quit: Leaving]
vicfred has joined #ocaml
curtosis is now known as curtosis[away]
curtosis[away] has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
oriba has quit [Ping timeout: 246 seconds]
curtosis[away] has joined #ocaml
mfp has quit [Ping timeout: 256 seconds]
laokz has joined #ocaml
curtosis[away] has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
dfeuer has quit [Ping timeout: 245 seconds]
mbuf has joined #ocaml
_whitelogger has joined #ocaml
vicfred has quit [Quit: Leaving]
vicfred has joined #ocaml
_whitelogger has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
elusive has quit [Quit: Leaving]
narimiran has joined #ocaml
laokz has quit [Ping timeout: 246 seconds]
shawnw has joined #ocaml
laokz has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
Haudegen has joined #ocaml
laokz has quit [Ping timeout: 264 seconds]
<d_bot_> <Laurent Cetinsoy> thanks for the tips !
<d_bot_> <Laurent Cetinsoy> I will check 🙂
bartholin has joined #ocaml
hosewiejacke has joined #ocaml
vicfred has quit [Quit: Leaving]
benc_ has joined #ocaml
sz0 has joined #ocaml
laokz has joined #ocaml
henistein has joined #ocaml
<henistein> I have to do a problem that consists of the following:
<henistein> I start with an initial amount N and I have to follow a series of rules, the goal is to end up with exactly 42.
<henistein> The rules are:
<henistein> (r1) if N is even, then I can return N / 2
<henistein> (r2) if N is a multiple of 3 or 4 then I can multiply the last two digits of N and return that amount
<henistein> (r3) if N is a multiple of 5 then I can return exactly 42.
<henistein> I still don't have much practice to solve this type of problem, which algorithm is the best for this type of problem? Backtracking, djikstra short path, or there is another one simpler?
dhil has joined #ocaml
<alexey> henistein: it looks much simpler, unless I miss something
<alexey> First, it's easy to pre-calculate the results for all possible results of r2, which range from 0 to 9x9=81
<henistein> but I need the short path, it will work if I do just recursive with pattern matching?
<alexey> Second, if you got N divisible by 5, you're done
<alexey> Third, if you got N divisible by 3 or 4, you can look at the pre-calculated table and know if r2 helps
<alexey> Fourth, if r2 doesn't help, try to divide by 2, rinse, repeat
<alexey> Okay, what I describe might not return the shortest path if the last digits ab bring you to the result, but the chain is longer than with last digits cd you could get by dividing by 2
<alexey> What you can do then is:
<alexey> Look at N, look at 2 last digits, remember the length of the path if we apply rule r2 (using precalculated table)
<alexey> Then, divide N by 2, and try again, if two last digist give shorter path -- remember it
<alexey> Keep dividing by 2 while possible
<henistein> hmm ok , I think am understanding
<henistein> just a detail that didn’t make me understand well, in rule 3 he will not return 42 soon he will remove 42 to the N
<henistein> 250 (3) → 208 (1) → 104 (1) → 52 (2) → 42
<henistein> There is an example
<alexey> 250 is divisible by 5, you just return 42 immediately
<alexey> this is the check you have to do before running the algorithm
<alexey> no, wait
<alexey> I don't understand what you mean
<alexey> how rule r3 works?
<henistein> No, the rule 3 will do N-42
<alexey> Ah
<henistein> so if I have 250 I will get 208
<alexey> not "return exactly 42", as you've written above :)
<henistein> yes sry
<alexey> np
<alexey> then it's not that straightforward
<henistein> yes it is an interesting problem
<alexey> but still, all the rules decrease the number
<alexey> so you can just do full search
<alexey> BFS, as you need shortest path
<d_bot_> <Christophe> what's the priority of rules though ? as 250 is even so shouldn't we do 250 (1) -> 125 ?
<alexey> I understood it like "you can choose any of the rules, you need to get to the end as fast as possible"
<d_bot_> <Christophe> aah I see, interesting /D
<d_bot_> <Christophe> 😄
<d_bot_> <darrenldl> so r2 is also "N - that amount" rather than "return that amount"?
<henistein> I will check BFS algorithm thank you
<d_bot_> <octachron> Note that some pen and paper exploration should reduce considerably the number of cases to test.
benc_ has quit [Remote host closed the connection]
mfp has joined #ocaml
mbuf has quit [Quit: Leaving]
nullcone has quit [Quit: Connection closed for inactivity]
bjorkintosh has quit [Remote host closed the connection]
bjorkintosh has joined #ocaml
benc has joined #ocaml
laokz has quit [Ping timeout: 245 seconds]
narimiran has quit [Ping timeout: 260 seconds]
nkatte has joined #ocaml
laokz has joined #ocaml
benc has quit [Remote host closed the connection]
benc has joined #ocaml
henistein has quit [Quit: Connection closed]
Haudegen has quit [Quit: Bin weg.]
nkatte has quit [Ping timeout: 264 seconds]
<d_bot_> <froyo> stumbled on this. i thought it'd be typeclasses but that looks a little more like cps
nkatte has joined #ocaml
laokz has quit [Ping timeout: 264 seconds]
laokz has joined #ocaml
laokz has quit [Ping timeout: 256 seconds]
shawnw has quit [Ping timeout: 246 seconds]
zebrag has joined #ocaml
Haudegen has joined #ocaml
narimiran has joined #ocaml
nepascourir has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
mxns has joined #ocaml
stux|RC has quit [Quit: Aloha!]
stux|RC has joined #ocaml
tane has joined #ocaml
mxns has quit [Ping timeout: 246 seconds]
vicfred has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 245 seconds]
dfeuer has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 245 seconds]
Haudegen has quit [Quit: Bin weg.]
nullcone has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
benc has quit []
iZsh has quit [Ping timeout: 256 seconds]
iZsh has joined #ocaml
dfeuer has quit [Ping timeout: 260 seconds]
JSharp has quit [Ping timeout: 265 seconds]
JSharp has joined #ocaml
JSharp has joined #ocaml
JSharp has joined #ocaml
JSharp has quit [Changing host]
JSharp has joined #ocaml
JSharp has quit [Changing host]
oriba has joined #ocaml
hosewiejacke has quit [Ping timeout: 260 seconds]
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
nepascourir has quit [Quit: Leaving]
JSharp_ has joined #ocaml
bartholin has quit [Quit: Leaving]
mxns has joined #ocaml
JSharp has quit [*.net *.split]
nkatte has quit [*.net *.split]
slt[m] has quit [*.net *.split]
peddie has quit [*.net *.split]
farn has quit [*.net *.split]
Armael has quit [*.net *.split]
JSharp_ is now known as JSharp
Armael has joined #ocaml
slt[m] has joined #ocaml
peddie has joined #ocaml
breitenj has quit [Quit: Quit]
mxns has quit [Ping timeout: 264 seconds]
Tuplanolla has joined #ocaml
hosewiejacke has joined #ocaml
farn has joined #ocaml
stites[m] has quit [Ping timeout: 240 seconds]
lnxw37d4 has quit [Ping timeout: 240 seconds]
flux has quit [Ping timeout: 249 seconds]
jimt[m] has quit [Ping timeout: 249 seconds]
aspiwack[m] has quit [Ping timeout: 249 seconds]
labor[m] has quit [Ping timeout: 249 seconds]
smondet[m] has quit [Ping timeout: 247 seconds]
tjammer[m] has quit [Ping timeout: 268 seconds]
avsm[m] has quit [Ping timeout: 268 seconds]
aditi314 has quit [Ping timeout: 268 seconds]
dash has quit [Ping timeout: 246 seconds]
slt[m] has quit [Ping timeout: 265 seconds]
pqwy[m] has quit [Ping timeout: 268 seconds]
BitPuffin has quit [Ping timeout: 268 seconds]
peddie has quit [Ping timeout: 265 seconds]
hosewiejacke has quit [Ping timeout: 245 seconds]
<d_bot_> <EduardoRFS> there is any way to add things like named parameters in Printf.sprintf ? So that you can say something like "%s{name}"?
<d_bot_> <Drup> @EduardoRFS not natively, there is a janestreet ppx that sortof kinda do that, (but, imho, not very well)
breitenj has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 256 seconds]
decentpenguin has quit [Read error: Connection reset by peer]
decentpenguin has joined #ocaml
smondet[m] has joined #ocaml
dfeuer has joined #ocaml
hosewiejacke has joined #ocaml
hosewiejacke has quit [Remote host closed the connection]
vicfred_ has joined #ocaml
dx_ has joined #ocaml
CissWit has joined #ocaml
haskell_1 has joined #ocaml
stux|RC-- has joined #ocaml
Johann has quit [Ping timeout: 256 seconds]
asm89 has quit [Ping timeout: 256 seconds]
haskell_enthusia has quit [Ping timeout: 256 seconds]
dx has quit [Ping timeout: 256 seconds]
stux|RC-only has quit [Ping timeout: 256 seconds]
landonf has quit [Ping timeout: 256 seconds]
vicfred has quit [Read error: Connection reset by peer]
White_Flame has quit [Ping timeout: 256 seconds]
asm89 has joined #ocaml
White_Flame has joined #ocaml
landonf has joined #ocaml
jimt[m] has joined #ocaml
aditi314 has joined #ocaml
flux has joined #ocaml
avsm[m] has joined #ocaml
BitPuffin has joined #ocaml
aspiwack[m] has joined #ocaml
lnxw37d4 has joined #ocaml
pqwy[m] has joined #ocaml
labor[m] has joined #ocaml
stites[m] has joined #ocaml
peddie has joined #ocaml
dash has joined #ocaml
tjammer[m] has joined #ocaml
slt[m] has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
jsoo has quit [Ping timeout: 264 seconds]
landonf has quit [Ping timeout: 264 seconds]
landonf_ has joined #ocaml
jsoo has joined #ocaml
<d_bot_> <clmill> hi all, been out of the loop lately; is anyone aware of e.g. guides or other writeups re: transitioning from reason/rescript to JSOO?
<d_bot_> <clmill> I'm aware of brr, but would love to read anyone's account of the transition before I start contemplating throwing myselff off the cliff 🙂
dfeuer has quit [Ping timeout: 240 seconds]
dx_ is now known as dx
waleee-cl has joined #ocaml
<companion_cube> that's probably what the new fork is going to address
nkatte has joined #ocaml
vicfred_ has quit [Quit: Leaving]
<d_bot_> <clmill> @companion_cube sorry, new fork?
Haudegen has joined #ocaml
<d_bot_> <clmill> so reason, but based on the latest OCaml, etc., and no language churn? 😍
<companion_cube> so it seems
<companion_cube> reason + BS, more precisely
<d_bot_> <anmonteiro> well, yes. OCaml comes for free
<d_bot_> <anmonteiro> also based on the latest Reason
<d_bot_> <anmonteiro> used as a library too.
<d_bot_> <anmonteiro> ReScript has always shelled out to the `refmt` binary
<d_bot_> <anmonteiro> which is... debatable
<d_bot_> <clmill> I've honestly never entirely understood where reason/OCaml/bucklescript started and ended
<d_bot_> <clmill> My main job is in the typescript mines 😛
<companion_cube> reason is purely syntax
<companion_cube> BS is a compiler to JS, in theory it shouldn't care what the syntax is… in theory
<d_bot_> <clmill> well, there's definitely reason-aligned libraries and tooling, too
<d_bot_> <clmill> but regardless, this sounds great at first blush
<d_bot_> <anmonteiro> let's see where the maintainer takes it
<d_bot_> <clmill> @anmonteiro isn't that you? 😛
<d_bot_> <anmonteiro> 😇
<d_bot_> <clmill> oh, I see the post is from just a few days ago!
<d_bot_> <clmill> didn't notice that at first
<d_bot_> <anmonteiro> Yeah, Friday
<d_bot_> <clmill> heh, what a confluence of events
<d_bot_> <clmill> well, if/when this app we have is slated for more serious work, I'll at least be able to provide some testing help
<d_bot_> <anmonteiro> That’d be great. My post was more of an RFC to see if it resonated with like minded folks
<d_bot_> <anmonteiro> Sounds like it did to some extent, and we’re working on making it ready for public consumption
<d_bot_> <anmonteiro> With my co-conspirator @EduardoRFS
oznt has quit [Ping timeout: 256 seconds]
oznt has joined #ocaml
<d_bot_> <clmill> maybe I'll try porting over this weekend just for funsies
<d_bot_> <clmill> though I'll have to disentangle the recent enhancements I've made from my removal of the object system usage, etc 😕
<d_bot_> <anmonteiro> please report back!
<d_bot_> <anmonteiro> there's a way to depend on it via esy
dfeuer has joined #ocaml
<d_bot_> <clmill> oh, I see, this gh-feed-reader is a PoC for that, etc
<d_bot_> <anmonteiro> yeah
<d_bot_> <clmill> well, I'll give it a roll sometime soon, and keep an eye out for news, etc. Thank you very much for even attempting it 😄
dhil has quit [*.net *.split]
hannes has quit [*.net *.split]
Leonidas has quit [*.net *.split]
seliopou has quit [*.net *.split]
averell has quit [*.net *.split]
penguwin has quit [*.net *.split]
Drup has quit [*.net *.split]
brettgilio_ has quit [*.net *.split]
nore has quit [*.net *.split]
tristanC has quit [*.net *.split]
valtr has quit [*.net *.split]
takside has quit [*.net *.split]
dhil has joined #ocaml
seliopou has joined #ocaml
Leonidas has joined #ocaml
hannes has joined #ocaml
tristanC has joined #ocaml
penguwin has joined #ocaml
Drup has joined #ocaml
nore has joined #ocaml
takside has joined #ocaml
valtr has joined #ocaml
averell has joined #ocaml
narimiran has quit [Ping timeout: 246 seconds]
brettgilio has joined #ocaml
<d_bot_> <mnxn> If you're still interested in JSOO, I wrote a short post about transitioning vscode-ocaml-platform from bucklescript to JSOO a while ago: https://mnxn.github.io/blog/ocaml/vscode-jsoo/
mxns has joined #ocaml
<d_bot_> <cemerick> Oh, that's exactly what I was hoping for originally, thank you!
<d_bot_> <cemerick> @clmill's story mirrors one of a friend that's been looking for case studies like this
mxns has quit [Ping timeout: 264 seconds]
takside has quit [Ping timeout: 256 seconds]
takside has joined #ocaml
<d_bot_> <clmill> yeah, this is what I was asking after
dhil has quit [Ping timeout: 256 seconds]
<d_bot_> <clmill> though @anmonteiro's fork would obviously be preferable if it's sustained
dhil has joined #ocaml
nore has quit [Ping timeout: 256 seconds]
nore has joined #ocaml
dfeuer has quit [Ping timeout: 264 seconds]
osa1 has quit [Remote host closed the connection]
osa1 has joined #ocaml
wagle has quit [Ping timeout: 264 seconds]
<Leonidas> wonder what cool new license rescript will come up with
<cemerick> Ironically, QPL was hinted at at some point
wagle has joined #ocaml
<d_bot_> <undu> I didn't know OCaml used to be released with the QPL
tane has quit [Quit: Leaving]
infinity0 has joined #ocaml
_whitelogger has joined #ocaml
stux|RC-- has quit [Quit: Aloha!]
_whitelogger has joined #ocaml
_whitelogger__ has joined #ocaml
_whitelogger__ has joined #ocaml
_whitelogger_ has joined #ocaml
_whitelogger_ has joined #ocaml
_whitelogger_ has joined #ocaml
<d_bot_> <anmonteiro> I think the licensing stuff was said in the heat of the moment. I wouldn't put too much weight on it, but let's see what happens.
<d_bot_> <anmonteiro> I think the licensing stuff was said in the heat of the moment. I wouldn't put too much weight on it, but let's see what happens.
<d_bot_> <anmonteiro> I think the licensing stuff was said in the heat of the moment. I wouldn't put too much weight on it, but let's see what happens.
mxns has joined #ocaml
mxns has joined #ocaml
mxns has joined #ocaml
curtosis has joined #ocaml
curtosis has joined #ocaml
curtosis has joined #ocaml
<cemerick> The reaction was useful
<cemerick> The reaction was useful
<cemerick> The reaction was useful