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
<staticassert> I thought pony was backed by LLVM? But I see references to gcc?
etc has joined #ponylang
Matthias247 has quit [Read error: Connection reset by peer]
etc has quit [Quit: Leaving]
staticassert has quit [Quit: Page closed]
jemc has quit [Ping timeout: 260 seconds]
CcxWrk has quit [Ping timeout: 240 seconds]
CcxWrk has joined #ponylang
gmcabrita has quit [Quit: Connection closed for inactivity]
jemc has joined #ponylang
abbiya has joined #ponylang
abbiya_ has quit [Ping timeout: 246 seconds]
amclain has quit [Quit: Leaving]
jemc has quit [Ping timeout: 264 seconds]
chemist69 has joined #ponylang
chemist69 has quit [Quit: WeeChat 1.7]
chemist69 has joined #ponylang
gmcabrita has joined #ponylang
<SeanTAllen> Pony 0.11.1 released: Fix for AVX problems with prebuilt compiler, FreeBSD compilation and building on Gentoo.
abbiya_ has joined #ponylang
abbiya has quit [Ping timeout: 240 seconds]
madgoat has joined #ponylang
madgoat has quit [K-Lined]
dougmacdoug has joined #ponylang
staticassert has joined #ponylang
jemc has joined #ponylang
jemc has quit [Client Quit]
jemc has joined #ponylang
etc has joined #ponylang
<etc> SeanTAllen: it seems `c.string()` returns a string of the integer value - is there a similar way to get the string of just the character that int represents?
_andre has quit [Ping timeout: 240 seconds]
<staticassert> Is there a sum type in Pony?
<staticassert> Also, in Erlang it seems like the way to handle errors is often to let the actor die, and then keep error handling code in a separate supervisor. But in Pony any errors in a behavior have to be handled.
<staticassert> Also, how can I disable the --march=native ?
<SeanTAllen> ah etc, i see what you are wanting. there is but i rarely do it so I would have to look it up.
<SeanTAllen> staticassert: yes type Foo is ( Type1 | Type2 | Type3 )
<staticassert> oh awesome, thanks SeanTAllen
<SeanTAllen> i've never tried to disable --match=native, i usually modify makefiles at that point, i assume it can be overridden from command line but ive never tried
<staticassert> It isn't a big deal, but having it as the default is an odd choice. I was going to try doing some basic benchmarks to see if it was worth it. With cloud infrastructure it's a lot harder to make use of CPU specific instructions.
<SeanTAllen> when those decisions where first made, it was to default to that which gives the best performance and then turn those off if they caused lots of issues.
<staticassert> Yeah, that makes sense. I'm just trying to jump into Pony and noticed it.
<SeanTAllen> and for example, the avx thing was becoming more and more of an issue, so we did the release last night to turn it off by default in prebuilt binaries
amclain has joined #ponylang
staticassert has quit [Ping timeout: 260 seconds]
atk has quit [Quit: Well this is unexpected.]
staticassert has joined #ponylang
<staticassert> lost connection
<staticassert> Yeah, I saw an issue about AVX
_andre has joined #ponylang
Praetonus has joined #ponylang
etc has quit [Ping timeout: 246 seconds]
atk has joined #ponylang
etc has joined #ponylang
etc has quit [Client Quit]
jemc has quit [Ping timeout: 240 seconds]
jemc has joined #ponylang
<SeanTAllen> staticassert: i have an answer for your gcc question. sometime in the distant past, for reasons that would be documented in the git log, Pony switched from calling ld directly to do thinking to using gcc to do linking which in turn calls ld or ld.gold or whatever. The end goal would be to start using `ldd` now that it is available but that will take time.
<SeanTAllen> Exact issue that is being worked around is no longer remembered, but is somewhere in the git history.
<SeanTAllen> my favorite quote in this is...
<SeanTAllen> "gcc calls ld under the hood to link but invokes it with magic"
<staticassert> ha, got it
<staticassert> I'm trying to write a 'pony by example' by the way - I figure it'll be a nice way to learn the language and hopefully contribute something of use
<staticassert> rustbyexample was a great help to me when learning
<SeanTAllen> that woud be awesome
<staticassert> Mostly trying to figure out how mdbook works lol but I have a repo and two very basic chapters
<SeanTAllen> gitbook has worked quite well for pony patterns and tutorial but might not meet your needs
<staticassert> It probably does, and I should probably just go with gitbook.
<SeanTAllen> i prefer asciidoc to markdown but markdown is far more widely known
<SeanTAllen> and in the end, for stuff like the tutorial etc was a driving factor in what was picked
<staticassert> Hm, steve klabnik helped me figure out how to get what I needed done in mdbook so for now I'll just stick with it.
<staticassert> But this is going to be a pretty rough first draft :P
<SeanTAllen> let me know when you have something you want to publicize and i will do my part
<staticassert> Will do. It's all in a private repo right now but I want to get some basic chapters done and then get an outline for the future chapters.
<staticassert> Is there any way to get format strings like "{} foo" where i could insert the value into foo, or is the way to go Format.int[u64](6) + " foo" ?
Matthias247 has joined #ponylang
<SeanTAllen> there's no string interpolation at this time
<SeanTAllen> i think there was an rfc or talk of an rfc
<staticassert> Cool, thanks
<staticassert> That's the current outline with a simple hello world chapter "completed"
<staticassert> Planning to fill it in based on the current chapter structure
<SeanTAllen> im interested to see how your approach differs from the tutorial
<SeanTAllen> i was going to write a pony book
<SeanTAllen> that starts from reference capabilities
<SeanTAllen> but something something time, life etc
<staticassert> Yeah, I was actually just writing that it's likely going to be similar to the tutorial but with less discussion of concepts and a different ordering
<staticassert> yeah, I know how that is :P
<staticassert> I'm kind of avoiding talking about reference capabilities, and even actors, until further in
<SeanTAllen> different folks learn in different ways so a by example would be good
<staticassert> agreed
<SeanTAllen> there's a scala book called "scala for the impatient"
<SeanTAllen> which is how i imagine the tutorial should be
<staticassert> The tutorial right now talks about reference capabilities, type safety, etc. It's kind of daunting in my opinion, it makes it feel *very* new and poweful, which is awesome but intimidating.
<staticassert> I think the nice thing about a 'by example' is that it's all code based. You show code, explain code. Minimal examples.
<SeanTAllen> ya
<SeanTAllen> that can be very good
<SeanTAllen> definitely good for a different sort of audience
<staticassert> And I get to learn Pony, so it should be fun
<staticassert> I do plan to take a lot of info from the tutorial though
<staticassert> Huh, so bool is defined as 1 bit in Pony?
<SeanTAllen> that is my rememberance
<SeanTAllen> i havent looked in a while, but i believe so, yes
<staticassert> Interesting
<SeanTAllen> i know many things vaguely
<SeanTAllen> i tend to only hold on to the most recently used things
<SeanTAllen> or things that really made an impression
<staticassert> :P I gotcha
<SeanTAllen> something something i just described being like most people
<staticassert> Are you one of the core developers? I don't know much about Pony or who's involved
<SeanTAllen> i am on the core team.
<staticassert> cool
<SeanTAllen> current core team: https://github.com/orgs/ponylang/teams/core
<SeanTAllen> Sylvan is the original brains behind Pony
<SeanTAllen> For members of the core team, I have the most practical experience with using Pony to build high performance activity
<SeanTAllen> Due to my work at Sendence
<SeanTAllen> Pony started as an actor library for C at a financial company. There were lots of data sharing problems from that, so Sylvan started working on a compiler, language to go with the run time while he was a PhD student at Imperial in London.
<SeanTAllen> So the runtime has extensive production usage, the langauge part over the top not so much.
<SeanTAllen> If you are interested in the development of Pony, I'd suggest joining the dev mailing list and you'll get emails about the weekly development sync call that happens every Wednesday.
<SeanTAllen> we go over issues, rfcs, PRs and also discuss issues that folks raise
<staticassert> awesome thanks
<staticassert> I may try to jump into the development side. Maybe building libs or something, I dont' have a ton of experienceiwth compilers.
<SeanTAllen> im around here or via email if you run into problems or looking for areas to help
<SeanTAllen> things like Pony by example would be huge
<SeanTAllen> there's lots of work on website, documentation, etc etc that most people don't want to contribute via that really help get people going
<staticassert> Awesome, well hopefully I'll have some time this weekend to put into it
jemc has quit [Ping timeout: 258 seconds]
jemc has joined #ponylang
_andre has quit [Quit: leaving]
Matthias247 has quit [Read error: Connection reset by peer]
staticassert has quit [Quit: Page closed]
jemc has quit [Ping timeout: 240 seconds]
staticassert has joined #ponylang
<staticassert> From: http://www.ponylang.org/ponyc/files-Directory/ , what is this referring to? "On FreeBSD, this allows the directory-relative functions to take advantage of Capsicum."
<staticassert> Also as far as I can tell from that documentation open takes one argument - the path, but I'm getting this error: not enough arguments Directory.open(directory)
<SeanTAllen> a capability rights descriptor
<SeanTAllen> staticassert: can you gist the code?
<staticassert> ye[
<staticassert> yep*
<SeanTAllen> i see
<SeanTAllen> open is not a constructor
<SeanTAllen> thats a horrid error message
<SeanTAllen> can you open an issue for that message
<staticassert> yeah so I'm thinking I needed to do a .create() right?
<SeanTAllen> ya
<SeanTAllen> which needs a file path
<SeanTAllen> and then you can open the directory instance
<SeanTAllen> and file path will lead you into capabilities
<SeanTAllen> so you are going to run into this:
<SeanTAllen> you can get the AmbientAuth needed for that from env
<SeanTAllen> have you done that yet?
<SeanTAllen> i mean worked with AmbientAuth at all?
<staticassert> Nope
<staticassert> Hm. This is interesting.
<staticassert> Does pony do actual sandboxing?
<SeanTAllen> you need a capability to open a socket, files etc
<SeanTAllen> the highest level authority is AmbientAuth
<SeanTAllen> which you can get from
<SeanTAllen> `Env.root`
<SeanTAllen> where it is either AmbientAuth | None
<SeanTAllen> so you need to match on Env.root
<SeanTAllen> or do something like
<SeanTAllen> where if `Env.root` is None, then an error will occur
<SeanTAllen> so you'd want an else to handle that
<SeanTAllen> try/else/end
<SeanTAllen> you need auth for sockets, files, process monitor etc
<staticassert> When would Env.root be None?
<SeanTAllen> it should only allow you to open files in that file path, not outside of it (symlinks though)
<SeanTAllen> you can constrain the runtime to not allow ambient auth
<SeanTAllen> or that is the idea
<SeanTAllen> so you could have a process that isnt allowed to do those things
<SeanTAllen> its not there yet but then you could do something like
<staticassert> #1 Awesome #2 Is there an auth level I can use other then AmbienAuth or is that required for this sort of thing
<SeanTAllen> allow a program to run with only say the capability to open sockets
<staticassert> like are there levels of auth
<staticassert> SeanTAllen: I wrote about doing this a few months ago in rust
<staticassert> or how I wanted to be able to do that
<SeanTAllen> so if you check out process monitor you will find
<SeanTAllen> type ProcessMonitorAuth is (AmbientAuth | StartProcessAuth)
<SeanTAllen> so you can either use process monitor with ambient auth or start process auth
<SeanTAllen> and you can create a start process auth only if you have ambient auth
<staticassert> Awesome
<SeanTAllen> so you can use that auth to create a more refined one
<staticassert> Can I define my own auths?
<SeanTAllen> yes
<SeanTAllen> so in this case
<staticassert> Can I create something like 'only allow reading a directory' instead of full directory access?
<SeanTAllen> if you dont have a ProcessMonitorAuth, your code won't compile
<SeanTAllen> you could do something like that
<SeanTAllen> all the capabilities stuff is currently limited to "create"
<SeanTAllen> but you could require a capability to call different methods
<staticassert> that is really cool - and this is backed on bsd by capsicum?
<SeanTAllen> appears to be
<SeanTAllen> it gets compiled in on OSX as well I noticed
<staticassert> Huh
<SeanTAllen> I havent ever dug that far down into it
<staticassert> I'm curious about the implementation.
<SeanTAllen> dive in!
<staticassert> I'll have to check that out at some point
<SeanTAllen> the first thing i did with pony was to write an echo server
<SeanTAllen> and then i went down through the code
<SeanTAllen> all the way to the asio event stuff
<SeanTAllen> and learned how it all worked
<staticassert> I guess I'll have to give that a shot
<SeanTAllen> then wrote up about 50% in a couple of blog posts
<Praetonus> staticassert: IIRC, there is FileCaps for fine-grained capabilities on files/directories
<staticassert> That's great
<SeanTAllen> oh yeah there is
<SeanTAllen> i had forgotten about that
<staticassert> I had no idea that pony had anything like this, I thought the capability safety was just about pointer semantics
<staticassert> not actual effects/ sandboxing
<SeanTAllen> yup
<SeanTAllen> good stuff
<staticassert> Are those capabliities applied at an actor level? That is, what is the level of enforcement for these policies
<staticassert> Actor level or pony-process level?
<SeanTAllen> per token usage level
<SeanTAllen> its basically, here is a primitive type
<SeanTAllen> it is an argument to a method
<SeanTAllen> in order to call the method, you need the type
<SeanTAllen> which in this case is an "unforgeable token"
<SeanTAllen> so...
<SeanTAllen> at the type system level
<staticassert> I guess I can see how it works in that sense - I get a capability, I need this to call a function, so unless I'm given it I can't call it, and once I have it I can hand it out but I can't hand out anymore 'more' than that.
<staticassert> Assuming that is correct, what I'm curious about is how capsicum fits into this
<staticassert> maybe I'm just confused :P
<SeanTAllen> im not sure
<SeanTAllen> would have to investigate
<SeanTAllen> i feel like i did once
<SeanTAllen> but it was long ago
<staticassert> yeah I'll just have to jump into it
<SeanTAllen> staticassert: im going to fix your issue.
<SeanTAllen> errrr
<SeanTAllen> i mean
<SeanTAllen> im going to rewrite the issue
<SeanTAllen> its confusing
<staticassert> Yeah, go for it
<SeanTAllen> you wrote a simpler example
<SeanTAllen> but put the old error message
<staticassert> ah, whoops
<staticassert> I'm trying to iterater over the return value of directory.entries() and getting an error. https://gist.github.com/insanitybit/0c69b5a2814ca009fa0cb0ce0270ee33
<SeanTAllen> thats a fun one
<SeanTAllen> let entries: Array[String] val = directory.entries()
<SeanTAllen>
<SeanTAllen> solves your problem
<staticassert> Is it just that I have to use the specific object capability, and like 'downcast' to it?
<SeanTAllen> its basically saying "these entries are immutable"
<SeanTAllen> so i dont understand the type inference that happens without it
<SeanTAllen> Array[String] iso^ is the return type of entries
<SeanTAllen> and it thinks your entries is of Array[String val] iso!
<SeanTAllen> im not sure why its getting iso!
<SeanTAllen> so
<SeanTAllen> iso!
<SeanTAllen> means this is an alias of an iso
<SeanTAllen> and iso's arent allowed to have aliases
<staticassert> that's confusing haha
<SeanTAllen> but the Array[String] iso^ shouldnt result in a iso! afaik
<staticassert> so just some weird type inference?
<SeanTAllen> this will help explain the ^ and !
<SeanTAllen> i think its a weird type inference
<staticassert> thanks
<SeanTAllen> nope its not
<SeanTAllen> ok so...
<SeanTAllen> entries:
<SeanTAllen> fun entries(): Array[String] iso^ ? =>
<SeanTAllen> sorry wrong thing
<SeanTAllen> so
<SeanTAllen> entries.values() is an iterator
<Praetonus> It should work if you do `(consume entries).values()`
<SeanTAllen> an iterator holds on to the collection
<SeanTAllen> yes
<SeanTAllen> but when its an iso,
<staticassert> cool, that makes sense
<SeanTAllen> you are saying no more than 1 alias
<SeanTAllen> again, i think that error message could be better
<SeanTAllen> it took me a minute to figure out where the alias was
<SeanTAllen> Praetonus: do you ever run into that problem of puzzling out where the alias is happening from an error message?
<staticassert> seems like it should return an array of Path not String
<Praetonus> SeanTAllen: Sometimes, but it's mostly in code with generics
<SeanTAllen> staticassert: so Path isnt a class, has no state, primitive when use liked that act as modules
<SeanTAllen> so Path is basically a collection of "file path" operations you can perform on Strings
<SeanTAllen> that said, stirng might not be the best representation of directory entries
<staticassert> oh, interesting
<SeanTAllen> Praetonus: iterators bite me every time
<SeanTAllen> i also have to go look at values implementation to remember. ¯\_(ツ)_/¯.
<SeanTAllen> staticassert: the bang/hat/arrow post is a good accompaniment to the VUG #1 video on generics
<staticassert> Hm. I'm using the FileInfo on a few paths. Some are directories and some are files - but .file and .directory appear to both always be true
<SeanTAllen> thats interesting
<staticassert> gonna try to confirm...
<SeanTAllen> if you find a problem, go ahead and open an issue for the bug
<SeanTAllen> time for me to call it a day
<SeanTAllen> might be around later
<staticassert> cool, thanks for all the help
staticassert has quit [Ping timeout: 260 seconds]