jemc changed the topic of #ponylang to: Welcome! Please check out our Code of Conduct => https://github.com/ponylang/ponyc/blob/master/CODE_OF_CONDUCT.md | Public IRC logs are available => http://irclog.whitequark.org/ponylang | Please consider participating in our mailing lists => https://pony.groups.io/g/pony
endformationage has quit [Quit: WeeChat 1.9.1]
mahtob has quit [Quit: Leaving]
mahtob has joined #ponylang
dipin has joined #ponylang
<mahtob> using u32 reduce really ram usage?
<mahtob> how can we decide using u32 or u64.is it same like in other languages? i use python generally so i asked
<SeanTAllen> mahtob: i work at Wallaroo Labs
<mahtob> hm let _time: (I64 val, I64 val) = Time.now() it is an example to ensure 2038 issue.isnt it
<SeanTAllen> we used a u32 because what we needed to represent could be represented in 32 bits
<SeanTAllen> The OS returns 64 bit values for time. that is why its I64 there
<mahtob> you mean when programming you already know or you sure it wont be an overflow ?
<SeanTAllen> thats too general to answer.
<SeanTAllen> in that case, we know its going to be a 32 bit value
<mahtob> yes i see clearly : like -> var message_count: I64 = 0
<mahtob> for counting more messages...
jnyw has joined #ponylang
dipin has quit [Quit: dipin]
ro6 has quit [Quit: Connection closed for inactivity]
jemc has quit [Ping timeout: 264 seconds]
jemc has joined #ponylang
dipin has joined #ponylang
sarna has quit [Quit: Connection closed for inactivity]
jemc has quit [Ping timeout: 256 seconds]
Xe has left #ponylang [#ponylang]
codec1 has quit [Read error: Connection reset by peer]
jemc has joined #ponylang
mahtob has quit [Remote host closed the connection]
jnyw has quit [Ping timeout: 255 seconds]
dipin has quit [Quit: dipin]
khan has joined #ponylang
jemc has quit [Ping timeout: 256 seconds]
dipin has joined #ponylang
dipin has quit [Ping timeout: 276 seconds]
jnyw has joined #ponylang
khan has quit [Quit: khan]
jnyw has quit [Quit: WeeChat 2.0.1]
bimawa1 has quit [Ping timeout: 265 seconds]
khan has joined #ponylang
bimawa1 has joined #ponylang
gokr has joined #ponylang
sarna has joined #ponylang
mahmudov has joined #ponylang
codec1 has joined #ponylang
<sarna> hey uhm, how do I exactly send message to other actors? I can't find it in the tutorial
<sarna> s/message/messages
<sarna> alright, found it in pony-patterns, kind of
kai3x5 has quit [Ping timeout: 265 seconds]
kai3x5 has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
<SeanTAllen> sarna: you call a behavior on the other actor
<SeanTAllen> behavior calls are message sends
<sarna> SeanTAllen: ah, alright.
<sarna> by the way, I've started to build a simple wrapper over math.h, and the performance is the same as in C
<sarna> I think there's no need to reinwent the wheel, and a simple wrapper would be enough
<SeanTAllen> its a good start sarna. in the end, Pony code is preferred where possible as it makes it easier for Pony users to contribute, has more type safety etc.
<SeanTAllen> However, its a very good start and would be welcomed. My suggestion. Do it as a library. Get people using the library. Get feedback. Once its nice and solid, consider opening an RFC for inclusion in the standard library.
<sarna> ok :)
<SeanTAllen> There's a github repo that has a lot of stuff to help you get started with setting up basics like CI etc for Pony libraries
<sarna> I'll check it out, thanks
<SeanTAllen> and listing of everything included
<sarna> ok
<sarna> hm, if I just return floats, do I need any capabilities? ie val or something
<SeanTAllen> No. All machine words are immutable. you can't change the value of F64 for example.
<SeanTAllen> 1.1 is always going to be 1.1
<sarna> so, capabilities are needed if I'm dealing with data that can be mutated?
<SeanTAllen> you need capabilities for anything that isnt a machine word
<SeanTAllen> from a purely technical perspective, anything with an object header (thats an implementation detail but important)
<sarna> ah, so for something that's on the heap?
<SeanTAllen> yes
<SeanTAllen> sort of
<SeanTAllen> actually lets say no
<sarna> oh no :D
<SeanTAllen> so
<SeanTAllen> do you know the difference between `let` and `var` in Pony?
<sarna> let - immutable, var - mutable?
<SeanTAllen> not really
<SeanTAllen> ok so this is slightly tricky
<SeanTAllen> let and var refer to the variable binding.
<sarna> hmm
<SeanTAllen> as in a variable defined with `let` can't be rebound. a variable defined with `var` can be rebound.
<sarna> what do you mean by rebound?
<SeanTAllen> when i variable is defined, its bound to something. a value or a location in memory
<sarna> `let x = 2; let x = 3;` is illegal?
<SeanTAllen> that is illegal yes but because its the same name twice
<SeanTAllen> let x = 2
<SeanTAllen> that binds x to 2
<SeanTAllen> you cant do
<SeanTAllen> x = 3
<sarna> yup
<SeanTAllen> because x is already bound
<SeanTAllen> if i did
<SeanTAllen> var x = 2
<SeanTAllen> then i can do
<SeanTAllen> x = 3
<SeanTAllen> because var allows rebinding
<SeanTAllen> make sense?
<sarna> yeah
<SeanTAllen> ok so...
<SeanTAllen> lets make it a touch more complex
<SeanTAllen> let foo: (String | None) = None
<SeanTAllen> can you tell me what is weird about that variable definition?
<sarna> it's always None, it doesn't need a sum type then?
<SeanTAllen> right, its kind of non-sensical
<SeanTAllen> i probably wanted `var`
<SeanTAllen> because i want to be able to rebind it
<SeanTAllen> note...
<SeanTAllen> var foo: (String | None) = None
<SeanTAllen> foo = "hi there"
<SeanTAllen> I didn't change the value of None to "hi there" I changed what foo is bound to
<SeanTAllen> does that make sense?
<sarna> yes
<SeanTAllen> ok,
<SeanTAllen> are you familiar with "pass by reference", "pass by value" ?
<sarna> yes
<SeanTAllen> actually scratch that. i dont want to explain that way. its not a good explanation
<SeanTAllen> ok... so
<SeanTAllen> var foo: String ref = "hi there"
<SeanTAllen> foo.append(" sarna")
<SeanTAllen> lets talk about that for a moment
<SeanTAllen> i have a rebindable variable `foo`
<SeanTAllen> that is a mutable string
<SeanTAllen> it starts as "hi there"
<SeanTAllen> and then i modify that string object to be "hi there sarna"
<SeanTAllen> make sense?
<sarna> yeah
<SeanTAllen> ok
<sarna> aren't strings immutable though? 🤔
<SeanTAllen> var foo: String ref = "hi there"
<SeanTAllen> foo = " sarna"
<SeanTAllen> no strings arent immutable, they are immutable by default
<SeanTAllen> i'm taking slight liberties with syntax around that
<SeanTAllen> in our second case
<SeanTAllen> we didnt modify the string "hi there"
<SeanTAllen> we rebound `foo` to "sarna"
<SeanTAllen> does that make sense?
<sarna> yup
<SeanTAllen> right so
<SeanTAllen> machine words
<SeanTAllen> ints, floats etc
<SeanTAllen> you cant change the value
<SeanTAllen> U64, F64 are immutable because of how the computer works
<SeanTAllen> so
<SeanTAllen> var foo: U64 = 1
<SeanTAllen> foo = 2
<SeanTAllen> I didnt change the value of 1 to 2
<SeanTAllen> i rebound foo from 1 to 2
<sarna> ah, I see
<SeanTAllen> F64 is immutable
<SeanTAllen> the bindings for variables it is assigned to might be rebindable
<SeanTAllen> so
<SeanTAllen> no, you don't need any reference capabilities on your F32 or F64 that you are returning
<SeanTAllen> and, no its not because they are on the stack
<SeanTAllen> i can stack allocate a string that could be String val or String ref
mahmudov has quit [Remote host closed the connection]
<sarna> thanks, it's clear now :)
<SeanTAllen> excellent
<SeanTAllen> sorry for the stops and starts
<SeanTAllen> its the first time ive explained all that in one go with someone
<SeanTAllen> i wasnt entirely sure how to proceed
<SeanTAllen> i kind of made it up as i went along
<sarna> np, it was a good explanation
mahmudov has joined #ponylang
<SeanTAllen> you can see all this summed up in https://playground.ponylang.org/?gist=69bef767b5d567b5f20af816ffacbb95
<SeanTAllen> well not "summed up"
<SeanTAllen> but its a small bit of code that can confuse folks when learning
<sarna> oh frick
<sarna> so, that reference can't be changed, but the underlying string can be?
<sarna> ie I can't make can_change to point to another string, but I can change the string's contents
<SeanTAllen> yes
<SeanTAllen> the binding cant be changed
<SeanTAllen> but the String is a `ref`
<sarna> can I make something truly immutable?
<sarna> I guess I'd achieve that by just not binding lets to refs
<SeanTAllen> yes
<SeanTAllen> but what do you mean by "truly immutable"?
<SeanTAllen> the object? the binding? or the combination of both?
<sarna> both
<sarna> oh, I'd just
<sarna> let val
<sarna> right?
<SeanTAllen> ummm
<SeanTAllen> let foo: String = "hi there"
<SeanTAllen> is "truly immutable"
<SeanTAllen> let foo: Myobject val = MyObject
<SeanTAllen> is as well
<SeanTAllen> it is as you said
<SeanTAllen> set up the variable with let and bind it to an immutable object
<sarna> I understand it now then. thank you :D
<SeanTAllen> you're welcome
<SeanTAllen> Two new RFCs have been opened:
<SeanTAllen> Remove HTTP server from the standard library - https://github.com/ponylang/rfcs/pull/117
<SeanTAllen> Remove existing case functions implementation from Pony - https://github.com/ponylang/rfcs/pull/118
<sarna> hm, is there any lifetime checking going on in pony?
khan has quit [Quit: khan]
khan has joined #ponylang
<SeanTAllen> no
<SeanTAllen> i assume you are referring to that ala Rust, yes?
<sarna> yep
<SeanTAllen> right then, no.
<sarna> are reference capabilities enough? Oo
<SeanTAllen> enough for what?
<sarna> for achieving safety
<SeanTAllen> yes
khan has quit [Client Quit]
<sarna> ie what if I'll use an object that's gone out of scope
khan has joined #ponylang
<SeanTAllen> how are you going to use an object that gone out of scope?
<sarna> what if I attempt
<sarna> :^)
<SeanTAllen> ... ?
<sarna> nevermind, I probably goofed up
<SeanTAllen> ok
gokr has quit [Ping timeout: 240 seconds]
gokr has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
gokr has quit [Remote host closed the connection]
winksaville has quit [Quit: Page closed]
winksaville has joined #ponylang
aturley has quit [Quit: aturley]
jemc has joined #ponylang
jemc has quit [Ping timeout: 255 seconds]
<sarna> I can't compile the httpserver example. I'm getting this error: https://p.teknik.io/lZhZu
<sarna> I have openssl installed, do you know what could be the issue?
<mahmudov> i can compile
<mahmudov> how do you get pony compiler?
<mahmudov> sarna i suspect it looks ld.gold to link it
<mahmudov> you are getting errors linkage stage
<sarna> from here
<sarna> I know
<mahmudov> have you ld.gold
<sarna> if I didn't, I wouldn't be able to link anything, no?
<mahmudov> i asked to be sure.
<sarna> I'm able to link normal programs, just not this example
<mahmudov> hmm
<mahmudov> which llvm version
<mahmudov> do you use?
<sarna> ponyc 0.21.2 compiled with llvm 5.0.1
<winksaville> @sarna, Looking at the error your system is using something other than openssl 0.9.0, what system are you using?
<sarna> winksaville: arch linux, openssl 1.1.0g
<winksaville> I use arch also, you need https://github.com/ponylang/ponyc/pull/2415
<mahmudov> pkg-config --libs openssl
<winksaville> @sarna, how did you install pony on your system?
<sarna> pacman -S ponyc
<winksaville> ponyc-rpm uses the debian build from bintray and includes openssl 0.9.0
<sarna> well, now I can't install it because of some PGP signatures that couldn't be verified
<SeanTAllen> winksaville: do you know much about git-lfs? i have a question about their deprecating `git lfs clone`. in particular git fls clone allowed you to only grab a single lfs entry when closing but git clone appears to grab everything.
<mahmudov> it seems same issue sarna
<mahmudov> i think it regards with openssl version
<sarna> thanks mahmudov
<winksaville> @SeanTAllen, I know nothing just that it exists, sorry.
<winksaville> @sarna, @mahudov: openssl 1.1.0 supports a different API and is not backwards compatible with openssl 0.9.0
<SeanTAllen> thanks winksaville. you mentioned it the other day so i was hoping i would luck into you having knowledge
<mahmudov> yes i see same issues for archlinux openssl 1.1.0
<mahmudov> seantallen how can we ldflags to ponyc ?
<mahmudov> can we pass*
<mahmudov> maybe sarna can compile 1.0.x and link with it
<SeanTAllen> what specifically are you trying to do mahmudov ?
<mahmudov> i dont try actually.i wonder how can we link diffrent libraries
<mahmudov> using -l'sslx' instead of -l'ssl'
<mahmudov> like it
<SeanTAllen> the -lssl comes from this in the source...
<SeanTAllen> use "lib:ssl"
<SeanTAllen> so the answer in your case would be you need to modify _ssl_init.pony in net/ssl/
<mahmudov> hm or just making object then manually linking with specific libraries ?
<SeanTAllen> you can do that yes
<SeanTAllen> you can have pony go through the compilation process and then link manually
<mahmudov> ponyc hasnt auto pass parameter for this.isnt it?
<SeanTAllen> but the -lssl comes from that use.
<SeanTAllen> not sure what "auto pass parameter" is.
dubiousjim has joined #ponylang
<mahmudov> ponyc LDFLAGS=""
<mahmudov> like it
<SeanTAllen> i've never tried, but i believe the answer is no
<dubiousjim> Hi I'm learning pony, and just stumbled upon references to `struct` in the Tutorial (FFI section), but it's never explained what's the difference between them and classes.
<dubiousjim> Can someone explain?
<SeanTAllen> structs are a special construct for working with C and should only be used for C-ffi
<SeanTAllen> a class in pony has an object header that is needed by the garbage collector and other bits of the runtime
<SeanTAllen> a struct has no such header
<SeanTAllen> so its good to pass to C
<dubiousjim> excellent, thanks
<SeanTAllen> but not good to use in general outside of using as a bridge to and from c where you need for specific c calls
<SeanTAllen> you're welcome
<winksaville> @seantallen, I watched this short video (https://www.youtube.com/watch?v=uLR1RNqJ1Mw)
dubiousjim has left #ponylang [#ponylang]
<winksaville> it implies the binaries could be stored directly in github/ponylang and then retrived from there. Not sure that helps but something.
<SeanTAllen> winksaville: thanks
<SeanTAllen> yes, i set it all up
<SeanTAllen> so i was able to setup the release process again so i can do a release tomorrow
<winksaville> good to be able to release :)
<SeanTAllen> its interesting, llvm 3.9.1 download is hosed but all the others are fine
<SeanTAllen> they have fastly sitting in front of it so it appears to be something at fastly is messed up
<mahmudov> yes seantallen i just produced object code then i can link libraries what i want
<SeanTAllen> excellent mahmudov
<mahmudov> taht you see i linked it with libarchive
<mahmudov> so i asked can we pass -l'archive' parameter directly at
<mahmudov> ponyc args.
<mahmudov> s/taht/that
<winksaville> @seantallen, when you say "llmv 3.9.1 download is hosed" you mean from llvm?
khan has quit [Quit: khan]
khan has joined #ponylang
<winksaville> I just downloaded llvm 3.9.1 and its sig from llvm.org and it was fine for me.
khan has quit [Client Quit]
khan has joined #ponylang
<SeanTAllen> hosed as in unable to download. errors out 99% of the time.
<SeanTAllen> llvm.org redirects to a fastly mirror
<SeanTAllen> depending on where you are, you get a different fastly mirror
<SeanTAllen> i for example get: l2.shared.us-eu.fastly.net.
<winksaville> how did you determine the mirror?
<SeanTAllen> nslookup releases.llvm.org
<winksaville> hmm, I get: l2.shared.us-eu.fastly.net too
<SeanTAllen> it took me about 5 hours to download the 3.9.1 for ubuntu xenial package
<SeanTAllen> but 4.0.1 and 5.0.1 are fine
<winksaville> :(
<SeanTAllen> 3.9.1 packages that ive tried are all almost impossible to get
<SeanTAllen> but i got the 2 i needed
<SeanTAllen> and they are in the github repo i created so. ¯\_(ツ)_/¯. i'm good for now
<winksaville> yea!!
<SeanTAllen> some weekend, ill update the dockerfiles to use the repo but given that they might never be rebuilt, its not high on my list of priorities
<winksaville> so is lfs the right solution for the long term or is something else needed?
<SeanTAllen> it worked quite well when i tested it
<SeanTAllen> its either that or something like ftp
<SeanTAllen> but then someone needs to host and maintain the ftp
<SeanTAllen> i'd rather leave the hosting and maintaining to github
<SeanTAllen> it downloads really qucik from github so, seems like a fine solution for now.
<winksaville> SG, should we move other dependencies there such as the one Gordon is hosting for windows?
<SeanTAllen> there's no dependencies hosted in his
khan has quit [Quit: khan]
khan has joined #ponylang
<SeanTAllen> all i saw was a script that knows how to download things
<SeanTAllen> im going to talk to him about its role in the process and about where it should live
<SeanTAllen> anyway, i got to run. y'all have fun. if anyone comes along and has questions, i'll be back later (probably tomorrow)
<winksaville> bye
winksaville has quit [Quit: Page closed]
khan has quit [Quit: khan]
khan has joined #ponylang
aturley has joined #ponylang
<mahmudov> i found.actually it is already found.i messed myself :)
<mahmudov> CC="cc -larchive" ponyc
<mahmudov> with this definition we can easily pass lib parameter to ponyc.
<mahmudov> so sarna i think if you compile openssl 1.0.x or 0.9 you can easily compile with this usage.
<sarna> that's great, thank you mahmudov
<mahmudov> youre welcome,i learned this with your triggering the issue :)
khan has quit [Quit: khan]
vaninwagen has joined #ponylang
dubiousjim has joined #ponylang
vaninwagen has quit [Ping timeout: 276 seconds]
<krig> I made a thing as a learning experiment: https://github.com/krig/pony-fmt Would appreciate comments :) (bad idea, bad style, both?)
<SeanTAllen> krig: can you add a pony-language topic to it on github? then its easier to find
<krig> SeanTAllen: done
<SeanTAllen> krig: i added it to the last week in Pony issue so it will be included. are you familiar with how to get things you do into last week in pony?
<SeanTAllen> also, if you are looking to add CI and other goodness to your new library krig, i suggest having a look at the library starter kit: https://github.com/ponylang/library-project-starter
<krig> SeanTAllen: ah, I wasn't no. But from what you just wrote I managed to figure it out :)
<krig> SeanTAllen: cool, thanks!
<SeanTAllen> i bookmarked your library krig. i'll try to take a look. i'm super busy all the time now between work and other pony work. and exhausted a lot of the time (and slightly cranky as a result), but i will endeavor to have a look next weekend.
<krig> SeanTAllen: no worries! poking around with pony is stress relief for me, so I wouldn't want to put undue pressure on anyone else as a result
<SeanTAllen> im hoping to get people uing the library starter kit so that there's feedback for documentation, "it would be nice if there was something that did X", "Foo doesnt work" etc. Almost all of it is extracted from my message pack library.
<SeanTAllen> the only reason i wrote the message pack library was as a testbed for extracting a library starter kit.
<krig> yeah, makes sense to have a common style for libraries
<SeanTAllen> anyway. got to run. if you give the library starter kit a go and run into issues krig, let me know.
<krig> will do, thanks again
jemc has joined #ponylang
<sarna> `double frexp(double x, int *exponent)` - how do I wrap this function?
jnyw has joined #ponylang
<sarna> `frexp(x: F64, exponent: Pointer[I32]): F64` ?
<SeanTAllen> sarna: yes. that look right.
<sarna> but then, when I want to call the C function.. `@frexp(x, exponent)` doesn't work. `addressof exponent` doesn't work either
<SeanTAllen> im not sure what you are trying to do
<SeanTAllen> perhaps i misunderstood you
<SeanTAllen> Pointer[X]
<SeanTAllen> is only for interacting with C code
<SeanTAllen> so
<SeanTAllen> you would have
<SeanTAllen> frexp(x: F64, exp: I32): F64 ?
<SeanTAllen> you'd need to take the pointer of exp inside you function to pass to frexp
<sarna> I'm just wrapping those C thingies in pony, so I can do `Math.sin(0.5)` instead of `@sin[F64](0.5)` or something
<SeanTAllen> probably
<SeanTAllen> i dont know how frexp works
<sarna> hold on
jemc has quit [Ping timeout: 256 seconds]
<SeanTAllen> o god lord, that's a nasty c function
<SeanTAllen> so
<SeanTAllen> its doing int* so that it can effectively have two return values yes?
<sarna> yeah
<sarna> and yeah it's nasty
<SeanTAllen> ok
<SeanTAllen> so
<SeanTAllen> I would make the Pony look like this...
<SeanTAllen> I'm faking this a little
<SeanTAllen> frexp(x: F64): (F64, I32) ?
<SeanTAllen> you only take a F64
<SeanTAllen> you return a tuple of F64 and I32
<sarna> oh my
<SeanTAllen> so inside your method, create a I32, give its address to C, return it as part of the tuple
<sarna> thanks, I'll try!
<SeanTAllen> you're welcome. i hope it works out. actually stepping away now.
dipin has joined #ponylang
<sarna> it works!!
<sarna> :D
jemc has joined #ponylang
jemc has quit [Quit: WeeChat 1.9]