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
SilverKey has joined #ponylang
aturley has quit [Read error: Connection reset by peer]
aturley has joined #ponylang
aturley has quit [Read error: Connection reset by peer]
SilverKey has quit [Quit: Halted.]
aturley has joined #ponylang
aturley has quit [Read error: Connection reset by peer]
aturley has joined #ponylang
SilverKey has joined #ponylang
aturley has quit [Read error: Connection reset by peer]
aturley has joined #ponylang
copy` has quit [Quit: Connection closed for inactivity]
SilverKey has quit [Quit: Halted.]
trapped has joined #ponylang
aturley has quit [Read error: Connection reset by peer]
rurban has joined #ponylang
aturley has joined #ponylang
trapped has quit [Read error: Connection reset by peer]
aturley has quit [Read error: Connection reset by peer]
aturley has joined #ponylang
rurban has left #ponylang [#ponylang]
srenatus has joined #ponylang
lispmeister has joined #ponylang
rurban1 has joined #ponylang
copy` has joined #ponylang
<Candle> Is there a way to find out why an error occured? F.ex. file system access can fail in so many ways, remembering to call 'errno' is going to catch prople out.
<Candle> Not all errors raised have a way to find out why it failed (like File.errno() ). basically what I'm thinking of is the ability to have a value type attached to the error that can contain some diagnostic information.
<jonas-l> Short answer: no, there's no way.
<jonas-l> Errors can be thought as a default problem reported
<jonas-l> if you call method `divide` and there's only one reason for it to fail
<jonas-l> e.g. division by zero
<jonas-l> then you simply use error to report it
<Candle> Yes, but, for example, there's a myriad ways for file.open(...) to fail.
<jonas-l> true
<jonas-l> in that case, you return problem as a value
<Candle> (it's not the perfect example because there's a work-around by calling errno in the 'else' block)
<jonas-l> a return type should be union type containing (UsualReturnType|Error1|Error2)
<Candle> So we ned up having every call with the go pattern of checking return codes after every call? "(err, ret) = func1(); if (err > 0) do_something() end"
<Candle> Personly, I find that pattern clutters the code, making it less readable.
<jonas-l> me too, but as far as I remember there are technical reasons why it's like this
rurban1 has left #ponylang [#ponylang]
<Candle> It would add complexity tot he (E)BNF of the language, sure. and if it's a value data structure, then on the face of it, I think it should continue to be thread safe.
<jonas-l> I think exceptions also cause some performance problems as well, but I don't remember the details.
<jonas-l> I guess corresponding section on the tutorial could provide an elaborate explanation on why the decision was made
<Candle> Exceptions are normally a performance hit. In other languages, there are normally ways to mitigate the hit by providing a check method first; e.g. the Iterator interface in pony has the has_next function to avoid you having to deal with an error on the next function (trivial example, but illustrates the point)
<SeanTAllen> Errors aren't exceptions. That's probably one of the biggest problems w the tutorial. It shouldn't use that word as it carries too much meaning from other languages. The error keyword indicates a partial function. Non computable result given the input. If you need to know why (i.e. not obvious from context) then the return type should be a union that
<SeanTAllen> includes possible error types. The file API really needs to be changed to do that.
<Candle> Ok, fair enough. try result = File.open("~~~"); result.write("something"); end" is likely to generate a compile error along the lines of "Error1 does not have a write function"
lispmeister has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jonas-l> let result = File.open("~~~") as WritableFile; result.write("something")
<jonas-l> will raise an error if the file is not WritableFile
mitchellvanw has quit [Quit: ZNC 1.6.3+deb1+trusty0 - http://znc.in]
<SeanTAllen> If you want to have an exception system that you can use for flow control than the option of either error or union types is going to be unsatisfactory
tm-exa has joined #ponylang
tm-exa has quit [Client Quit]
tm-exa has joined #ponylang
tm-exa has quit [Client Quit]
tm-exa has joined #ponylang
Jbbouille has joined #ponylang
<Jbbouille> SeanTAllen: Hello, concerning ponyc release process, do you have some things on this subject ? I could not attempt the meeting last Wednesday but I am OK for this week (if my presence is needed).
Jbbouille has quit [Quit: Page closed]
_andre has joined #ponylang
trapped has joined #ponylang
chac has joined #ponylang
<chac> hi! just had a short question while trying to write a generic load balancer: whats the type of a message in pony?
Praetonus has joined #ponylang
lispmeister has joined #ponylang
<doublec> chac: behaviours are what messages are in pony
<doublec> chac: so when you call a behaviour it queues a message behind the scenes in the runtime
<doublec> chac: so there's no explicit 'message'
<chac> doublec: thanks. so if i wanted to invoke a behaviour on an actor behind a load balancer would i need to pass its arguments around manually?
<doublec> chac: I'm not sure what you mean by a load balancer
<doublec> chac: but if you mean another actor in pony then yes, it would need to call the behavior explicitly with its arguments
<doublec> chac: there is no distributed pony yet (that I know of) so calling a behaviour from another program would require explicitly coding it using sockets or something
TwoNotes has joined #ponylang
<chac> doublec: imagine i have 3 types of actors: A instance of type P is invoking behaviours on actors of type S. i do not want to call those behaviours directly, but instead call them on a load balancer, that then distributes those calls("messages") to the actors of type S.
<chac> doublec: it's a toy example, i just want to get a feeling for the language
<TwoNotes> Load balancing across nodes?
<TwoNotes> Pony does not do distributed behavior calls yet. This summer I think
<chac> nah that does not really matter to me. i just wanted to express that in the language itself
<TwoNotes> You would have to have an intervening actor that implements the load-balancing function
rurban has joined #ponylang
<jonas-l> chac: if you would like to distribute between actors (of type S), then as doublec said: you have to call behavior and explicitly pass arguments
<chac> okay thats a pitty. Thank you all :)
<jonas-l> you could, of course, create a class MyMessage which encloses all the arguments, and have a method `apply(S actor)` where you would call the behaviour
<jonas-l> and then, depending on which actor was selected by the balancer, pass it to the message
<jonas-l> but it's not Pony specific: you could do it in any language
<TwoNotes> Or if over a network, send UDP messages that encapsulate the parameters and use a real load balancer
<TwoNotes> Trying to build ponyc in a 32bit Arch system, I get undefined reference to `llvm::FunctionPass::createPrinterPass`, yet llvm 3.7.1-1 is installed
jemc has joined #ponylang
<Praetonus> TwoNotes: Might be a LTO issue. What is your make command?
<TwoNotes> make build=release
<TwoNotes> Hmm, I see the llvm so file, but it is named libLLVM.so (in upper case). That looks odd
<TwoNotes> But that seems to match what is on my Ubuntu system, though the directories are arranged differently
<TwoNotes> The 32b Arch system is quite old, has not been updated since last year. I was putting off putting a stable Ubuntu LTS release on there
chac has quit [Quit: Page closed]
SilverKey has joined #ponylang
Praetonus has quit [Ping timeout: 260 seconds]
Praetonus has joined #ponylang
Praetonus has quit [Quit: Leaving]
Jbbouille has joined #ponylang
<Jbbouille> TwoNotes: 'pcre2 clang llvm llvm-libs ncurses gcc-libs zlib openssl make gcc git' all of these are installed ?
<SeanTAllen> Jbbouille: yes, attending the sync meeting would be a good place to talk about release process
jemc has quit [Quit: WeeChat 1.4]
jemc has joined #ponylang
rurban has quit [Quit: Leaving.]
rurban has joined #ponylang
graaff has joined #ponylang
amclain has joined #ponylang
<_andre> what could be the reason for the puppet master not to find the environments defined in puppet.conf?
<_andre> i'm getting "The environment must be purely alphanumeric, not ''" but only via passenger
<jemc> _andre: seems like you're probably asking in the wrong channel by mistake :)
<_andre> ugh
<_andre> not my day today :(
<_andre> sotty for the noise
<_andre> sorry, even
<jemc> no worries - hope it works out :)
<Candle> sotty nose?
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
rurban1 has joined #ponylang
rurban has quit [Ping timeout: 252 seconds]
gsteed has joined #ponylang
SilverKey has quit [Quit: Halted.]
rurban has joined #ponylang
rurban1 has quit [Ping timeout: 252 seconds]
tm-exa has quit [Quit: Computer has gone to sleep]
rurban has left #ponylang [#ponylang]
SilverKey has joined #ponylang
SilverKey has quit [Client Quit]
tm-exa has joined #ponylang
tm-exa has quit [Client Quit]
tm-exa has joined #ponylang
lispmeister has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rurban1 has joined #ponylang
SilverKey has joined #ponylang
SilverKey has quit [Client Quit]
rurban1 has quit [Quit: Leaving.]
SilverKey has joined #ponylang
trapped has quit [Ping timeout: 260 seconds]
trapped has joined #ponylang
graaff has quit [Quit: Leaving]
<TwoNotes> Jbbouille, yes all of those are installed but the linker does not find llvm::FunctionPass::createPrinterPass
aturley has quit [Read error: Connection reset by peer]
SilverKey has quit [Quit: Halted.]
aturley has joined #ponylang
tm-exa has quit [Quit: Computer has gone to sleep]
trapped has quit [Ping timeout: 276 seconds]
SilverKey has joined #ponylang
SilverKey has quit [Client Quit]
tm-exa has joined #ponylang
SilverKey has joined #ponylang
everyonemines has joined #ponylang
<everyonemines> I was looking for a SSA IR with GC for a toy language I was working on....
<everyonemines> but I couldn't find much info about the compilation stages for Pony's compiler.
<everyonemines> Does it use some pre-LLVM IR representation for its own optimizations?
<jemc> everyonemines: the Pony compiler works as a set of passes over a data structure which begins as an Abstract Syntax Tree, but actually accumulates more information than just an AST, and works sort of like a proper IR, even though we keep calling it an AST
<everyonemines> is it SSA?
<everyonemines> or you're saying....
<everyonemines> There's a series of intermediate stages that are not clearly delineated?
<everyonemines> For comparision, here's MLton: http://mlton.org/IntermediateLanguage
<jemc> the passes are clearly delineated, but the AST is not as standalone as I would like (but that is on my personal roadmap for Pony improvements, as I also want to integrate other language frontends and tooling)
<jemc> as for being SSA, no, it's not
<everyonemines> Is there a good point for someone to connect another frontend?
<everyonemines> before GC is handled?
<everyonemines> Originally I was considering MLton -> LLVM but
<everyonemines> MLton is slow, LLVM is big, MLton allocates its own stack on the heap when using LLVM or GCC...etc....
<everyonemines> I'd target LLVM but I don't wanna do GC myself. :-/
<jemc> no, but there will be soon - currently you can make the compiler run passes 0 through N and output an AST, but not the other way around (take in an AST and run stages N through M)
<everyonemines> In any case, there is a need for a new multicore language....
<everyonemines> Me, I wanted OCaml with overloading, and I solved the type inference problem for overloaded functions, but
<everyonemines> compilers are too much work.
<jemc> like I said, opening up possibilities for other language frontends is a big goal on my personal roadmap, I want to encourage those efforts
<everyonemines> Is there a list of passes in the docs somewhere?
<everyonemines> oh, thanks
<jemc> a few of the passes are not documented/explained in that list, they are marked as "TODO"
<jemc> again, the TODO means implemented, but not documented
<everyonemines> so GC is handled at the LLVM IR generation stage?
<everyonemines> or rather,
<everyonemines> it goes finalizer -> LLVM IR gen
<everyonemines> and the finalizer creates annotations for GC in the next stage?
<jemc> if I recall correctly, the finalizer pass is only a check that finalizers don't do "bad things" and it doesn't actually generate anything
<jemc> I'm not sure exactly what you're asking about with the GC, but all the code dealing with allocations and per-actor ref counts for the GC will come out of the LLVM IR generator (along with all other generated code), yes
<everyonemines> Right, I got that from your last line.
<jemc> everything up to that point is working with an abstract version of the code that doesn't know anything about allocations, or any other runtime-specific stuff
<everyonemines> You're making it sound like the LLVM IR gen pass is
<everyonemines> half the entire compiler.
<jemc> in a way, sort of - the preceding passes revolve around parsing input and ensuring correctness
<jemc> and resolving types, and so on
<everyonemines> What parser generator are you using?
<everyonemines> I was actually considering doing something ~~crazy~~ and instead of using a parser generator,
<everyonemines> using Ragel to compile a state machine instead. :-)
srenatus has quit [Quit: Connection closed for inactivity]
<everyonemines> oh, wow
<jemc> the tokens are parsed with an LL(1) parser implemented here: https://github.com/ponylang/ponyc/blob/master/src/libponyc/ast/parserapi.c
<everyonemines> In C, too.
<jemc> the parser grammar is assembled with C macros: https://github.com/ponylang/ponyc/blob/master/src/libponyc/ast/parser.c
<jemc> regarding the hand-written lexer, the original devs took great care to make Pony an easy-to-parse language, avoiding ambiguity wherever possible
<jemc> regarding being written in C, we do have plans to eventually rewrite the compiler in Pony, in stages (one pass at a time)
<everyonemines> Well, personally
<everyonemines> I think that self-hosting compilers are overrated.....
<everyonemines> Pony is faster than python, but the C version might be faster than the Pony version
<everyonemines> and it can be harder to make significant changes to a self-hosted language.
<everyonemines> Well, it's usually not a big deal either way.
<everyonemines> And of course, LLVM is still going to be C++.
<jemc> the second point is definitely a concern, as we're still changing the language every now and then at this stage of maturity
<jemc> for example, we renamed an operator last week
<jemc> regarding LLVM, it has a C API, not just a C++ one
<jemc> so the C API can be invoked from any language with an FFI (Pony has one)
<everyonemines> er, I mean that LLVM is written in C++
<everyonemines> so your compiler will never be completely "self-hosting"
<everyonemines> I've heard that it's better to use the C API because it's more stable.
SilverKey has quit [Quit: Halted.]
tm-exa has quit [Quit: Computer has gone to sleep]
<jemc> sure, we're not going to rewrite LLVM, but we can rewrite the part we're responsible for maintaining (ponyc)
<jemc> libponyrt will probably always be in C, for practical reasons though
<jemc> (the library that implements the runtime)
Praetonus has joined #ponylang
aturley has quit [Read error: Connection reset by peer]
aturley has joined #ponylang
SilverKey has joined #ponylang
rurban has joined #ponylang
rurban1 has joined #ponylang
rurban has quit [Ping timeout: 265 seconds]
<doublec> jemc: what was the operator that was renamed?
<jemc> identityof -> digestof
<jemc> was discussed on last week's sync call that the old name was misleading folks (including me) to trying to do the wrong thing with that operator
<jemc> there's an explanation in the ticket that the pull request closes
SilverKey has quit [Quit: Halted.]
<doublec> thanks
TwoNotes has quit [Quit: Leaving.]
Praetonus has quit [Quit: Leaving]
rurban1 has quit [Ping timeout: 276 seconds]
everyonemines has left #ponylang [#ponylang]
jemc has quit [Ping timeout: 265 seconds]
gsteed has quit [Quit: Leaving]
yonkeltron has quit [Changing host]
yonkeltron has joined #ponylang