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
<Lordovos> Howdy.
emancu has joined #ponylang
Matthias247 has quit [Read error: Connection reset by peer]
emancu has quit []
jemc has joined #ponylang
<Lordovos> So hey, I had a few questions about Pony. Is anyone around to answer them?
emancu has joined #ponylang
<jemc> Lordovos: sure, please ask away
<jemc> and welcome!
<Lordovos> Is there a list of projects using Pony anywhere?
c355e3b has quit [Quit: Connection closed for inactivity]
<jemc> So far, the projects that have been using Pony commercially have tended to be rather private about it (often, financial tech) - but right now probably the best way to find open source projects using Pony would be to search through GitHub by source type
<Lordovos> Ah. I didn't think to try searching like that. Thank you! Also: I'm having trouble understanding one of the example files. The standard library reference doesn't really explain a lot about whats' going on in this snippet: https://github.com/ponylang/ponyc/blob/master/examples/files/files.pony
<jemc> I'm guess you're wondering mostly about the `with` block?
<Lordovos> Honestly I'm rather confused by the first line: "let caps = recover val FileCaps.set(FileRead).set(FileStat) end" There seems to be a lot going on here.
<jemc> so, `FileCaps` happens to be a use of the `Flags` class in the `collections` package, which is a type-safe wrapper for C-style OR'd bitflags, if you're familiar with those
<jemc> you can read the definition of `FileCaps` here: https://github.com/ponylang/ponyc/blob/master/packages/files/file_caps.pony
<jemc> so the line you referenced, creates an instance of the `FileCaps` class, sets the `FileRead` flag (which corresponds to the bit `1 << 6`) and the `FileStat` flag (which corresponds to the bit `1 << 10`)
<jemc> basically, those two bits get bitwise-OR'd together to make the bitflags accepted by the C API used by the files package implementation
<jemc> you can see the implementation of the `Flags` class here: https://github.com/ponylang/ponyc/blob/master/packages/collections/flag.pony
<jemc> in short, it's a way of bringing that messy and error-prone bitflag operations into the Pony world, in a type safe way
<Lordovos> Aha. That makes more sense. What are 'recover' and 'val' doing though?
<jemc> have you read through the section of the tutorial covering reference capabilities yet?
<jemc> (for example, do the keywords `ref`, `val`, and `iso` mean anything to you?)
<Lordovos> I didn't get that far. It'd help if I did, lol.
<jemc> in this situation, the `FileCaps` object is created as a `ref` inside the block, but the `recover` block "lifts" the capability to a `val`
<Lordovos> Oh. Hmm. It sounds like refs are kind of like pointers.
<jemc> that's a decent guess based on the terminology, but happens to be wrong, and it'll lead you down the wrong set of ideas :)
<jemc> reference capabilities are one of the key unique features that pony brings to the table, but they also take some time to fully wrap your head around
<jemc> `ref` and `val` are pretty simple if you're familiar with the concept of mutability vs immutability
<jemc> basically, `ref` is a mutable reference, and `val` is an immutable reference
<Lordovos> Sort of like var and let?
<jemc> not quite - `var` and `let` have to do with whether you can *reassign* a local or field reference to something else, which is a distinct concept from whether or not you are allowed to *mutate* the reference
<jemc> one analogy for thinking about reassignment vs mutation would be the difference between buying a new car (reassignment) or doing engine repair on the car you have (mutation)
<Lordovos> Ooh. That's a pretty good analogy.
<jemc> in concurrent code, immutability is a pretty important concept, because it allows multiple threads to share the same reference to memory while being confident that their view of the data in it will never be changed by the activity of another thread
<jemc> in fact, many programming languages go in the direction of trying to make *everything* immutable for the purpose of getting those benefits, though it does have downsides as well
<jemc> Pony doesn't take an all-or-nothing approach on immutability - mutable and immutable objects can coexist in the same world, as long as they follow the rules around reference capabilities
<jemc> and the Pony compiler is what statically guarantees that these rules are followed throughout your entire program
<Lordovos> I see. So why does Pony choose to have all of this instead of something simpler like OpenFile("whatever.txt", FILE_READ & FILE_STAT)? Layers of safety?
<Lordovos> (I'm only used to using languages like JavaScript and a little bit of C so forgive me if I'm being naive).
<jemc> not sure how better to summarize other than to say Pony makes some easy things a bit harder for you so that it can make some very hard things easy for you :)
<jemc> I did a talk last spring about Pony that doesn't get deep into teaching the language, but spends some time talking about the core principles and motivations for the decisions that were made, and why it might be useful to you: https://www.linuxfestnorthwest.org/file/linuxfest-northwest-2016-pony-language-provably-safe-lockless-concurrency
<Lordovos> If I wanted to learn more about programming in Pony, are there any other resources outside of the tutorial?
<jemc> we're working on documenting some common design patterns and practices, but it's quite far from complete: https://github.com/ponylang/pony-patterns
<Lordovos> Alright. Thank you. :)
<jemc> other than that, I'd suggest trying to read more code and asking more questions (though you probably won't get very far in real-world code until you've read through the tutorial once or twice - at least up through understanding reference capabilities)
<Lordovos> Is Pony's "with {} do" similar to Python's?
<jemc> also, we have a "virtual users group" that meets online and folks give presentations which are recorded for posterity, so watching some of those may be helpful to you: https://www.youtube.com/channel/UCdUjon7E88C4jwVm0iiNIsA
<jemc> pretty similar, yes - basically in this example, it ensures that the `dispose()` method of the `file` is called just before the block exits, no matter if it exits with an `error` raised or an early `return` or just runs to the end of the block
<Lordovos> Ah.
<Lordovos> Would Pony be a suitable language to develop games in? Or is it not geared towards that sort of thing?
Perelandric has quit [Ping timeout: 260 seconds]
<jemc> Some folks have been working toward some game frameworks, though I think they're not very far along yet, so it may not be the best bet if you're looking for a well-trodden path
<Lordovos> I mainly like new languages, and Pony looks pretty interesting. It has a lot of concepts I've never seen before.
<jemc> one of the virtual user group presentations was about a game framework in progress - https://www.youtube.com/watch?v=waYj4eV0RFE
<Lordovos> Thanks for the link. And thanks for being patient with me and explaining things jemc. :)
emancu has quit []
Lordovos has quit [Quit: Page closed]
jemc has quit [Ping timeout: 265 seconds]
amclain has quit [Quit: Leaving]
Xe has quit [Ping timeout: 260 seconds]
rurban has joined #ponylang
Xe has joined #ponylang
prettyvanilla_ has joined #ponylang
Candle_ has joined #ponylang
unbalancedparen has joined #ponylang
unbalanced has quit [*.net *.split]
Candle has quit [*.net *.split]
prettyvanilla has quit [*.net *.split]
_andre has joined #ponylang
zevlg has joined #ponylang
rurban has quit [Quit: Leaving.]
TwoNotes has joined #ponylang
<TwoNotes> See issue 1445 for additional information on the strtof bug
jemc has joined #ponylang
<TwoNotes> jemc, could that wrong choice of register be LLVM's fault? Or something Pony tells LLVM?
Praetonus has joined #ponylang
c355e3b has joined #ponylang
The_Brofessor has joined #ponylang
<TwoNotes> I have added the LLVM IR code to the issue
<TwoNotes> It is all Greek to me but maybe there are clues there
<TwoNotes> I see new issue 1451 and will make any future comments there
<jemc> yeah, just didn't want to muddy the waters with two different bugs in the same ticket
<jemc> thank you for your work so far in troubleshooting, I think the LLVM IR will definitely give us some clues
<TwoNotes> I have tried installing later LLVM versions, but none of the ones on the 'supported' list are available as ubuntu packages yet
<jemc> as to your question about whether its Pony's fault or LLVM's fault - I tend to assume in general that the blame is on Pony until I see evidence otherwise, since LLVM is much more widely used, but we *have* seen LLVM bugs in the past
<jemc> was just about to suggest that you might try newer LLVM versions, but sounds like that isn't possible
<jemc> I definitely wouldn't want to try compiling LLVM on a Raspberry Pi :D
<TwoNotes> I have tried building 3.9.0 but it is a real monster and I have not gotten it to work properly yet
<TwoNotes> Well, you need a swapfile tostart with, or it runs out of memory compiling some parts
<TwoNotes> There is an LLVM 4.0 too
<TwoNotes> There is a downloadable binary 3.9.0 for ARM, but it seems to be for a different ABI level than Pony wants.
<TwoNotes> Hmm, there is a way to force gcc to use the older ABI isnt there? Maybe if I built ponyc that way, it would link properly with this LLVM 3.9 library
rurban has joined #ponylang
prettyvanilla_ has quit [Ping timeout: 248 seconds]
<TwoNotes> I am guessing that the LLVM binaries were compiled with the CLANG compiler, not GCC
amclain has joined #ponylang
The_Brofessor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
The_Brofessor has joined #ponylang
prettyvanilla_ has joined #ponylang
rurban has quit [Quit: Leaving.]
rurban has joined #ponylang
rurban has quit [Client Quit]
aturley has joined #ponylang
<TwoNotes> LLVM 3.9 requires libncurses v6, which I do not have. Argh, version hell is why I switched to Ubuntu in the first place
TwoNotes has quit [Quit: Leaving.]
TwoNotes has joined #ponylang
TwoNotes1 has joined #ponylang
TwoNotes1 has left #ponylang [#ponylang]
aturley has quit [Ping timeout: 260 seconds]
The_Brofessor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rurban has joined #ponylang
rurban has quit [Client Quit]
rurban has joined #ponylang
rurban has quit [Client Quit]
jmiven has quit [Quit: co'o]
Praetonus has quit [Quit: Leaving]
jmiven has joined #ponylang
aturley has joined #ponylang
aturley has quit [Ping timeout: 260 seconds]
aturley has joined #ponylang
The_Brofessor has joined #ponylang
_andre has quit [Quit: leaving]
aturley has quit [Ping timeout: 245 seconds]
<TwoNotes> LLVM 390 wanted ncurses v 6, which I can't get. So I am trying llvm 3.8.1
aturley has joined #ponylang
<TwoNotes> LLVM 381 is the one where ponyc does not link properly. Unresolved externals to createPrinterPass in LLVM. We suspected the ABI change to be at fault. Now I can apply the "use old ABI" trick..
aturley has quit [Ping timeout: 245 seconds]
aturley has joined #ponylang
aturley has quit [Ping timeout: 244 seconds]
rurban has joined #ponylang
<TwoNotes> The ABI changes in gcc seem to be about the definition of std::string.
Matthias247 has joined #ponylang
aturley has joined #ponylang
<doublec> The use of isolated, consume and using that for passing references for safe concurrency reminds me of pony http://joeduffyblog.com/2016/11/30/15-years-of-concurrency/
<jemc> > A principle in Midori was the elimination of ambient authority. This enabled capability-based security, however in a subtle way was also necessary for immutability and the safe concurrency abstractions that are to come.
<jemc> sounds familiar too :)
TwoNotes has quit [Quit: Leaving.]
TwoNotes has joined #ponylang
<doublec> indeed :)
jemc has quit [Ping timeout: 268 seconds]
<TwoNotes> It just struck me that the code generated by Pony on ARM is assuming soft-floating point, while GCC is using hard-floating point
<TwoNotes> Onbiously, different registers are used
<TwoNotes> @strtof is returning its result in the hard FP register 0 so a VSTR instruction has to be used.
<TwoNotes> But the LLVM target-triple mentions this, "arm-unknown-linux-gnueabihf" The "hf" at the end designates 'hard float'
<TwoNotes> ponyc will not accept 'armhf' as a cpu type
<TwoNotes> Ther LR code clearly says "store float" but LLVM is not generating the right instruction for that on this hardware.
TwoNotes has quit [Quit: Leaving.]
aturley has quit [Ping timeout: 250 seconds]
rurban has quit [Quit: Leaving.]
aturley has joined #ponylang
c355e3b has quit [Quit: Connection closed for inactivity]