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
tm-exa has joined #ponylang
tm-exa has quit [Quit: Computer has gone to sleep]
SirWillem has joined #ponylang
SirWillem has quit [Ping timeout: 276 seconds]
jmbi has joined #ponylang
SirWillem has joined #ponylang
SirWillem has quit [Remote host closed the connection]
c355e3b has quit [Quit: Connection closed for inactivity]
jemc has joined #ponylang
copy` has quit [Quit: Connection closed for inactivity]
jmbi has quit [Quit: Lost terminal]
graaff has joined #ponylang
trapped has joined #ponylang
jemc has quit [Ping timeout: 276 seconds]
trapped has quit [Read error: Connection reset by peer]
trapped has joined #ponylang
trapped has quit [Read error: Connection reset by peer]
trapped has joined #ponylang
gsteed has joined #ponylang
Praetonus has joined #ponylang
tm-exa has joined #ponylang
trapped has quit [Read error: Connection reset by peer]
trapped has joined #ponylang
trapped has quit [Read error: Connection reset by peer]
trapped has joined #ponylang
c355e3b has joined #ponylang
copy` has joined #ponylang
jemc has joined #ponylang
tm-exa has quit [Quit: Computer has gone to sleep]
tm-exa has joined #ponylang
tm-exa has quit [Ping timeout: 240 seconds]
graaff has quit [Quit: Leaving]
Applejack_ has joined #ponylang
Matthias247 has joined #ponylang
jemc has quit [Ping timeout: 252 seconds]
tm-exa has joined #ponylang
Applejack_ has quit [Ping timeout: 250 seconds]
tm-exa has quit [Ping timeout: 252 seconds]
unbalancedparen has joined #ponylang
tm-exa has joined #ponylang
tm-exa has quit [Ping timeout: 264 seconds]
Applejack_ has joined #ponylang
tm-exa has joined #ponylang
tm-exa has quit [Ping timeout: 244 seconds]
tm-exa has joined #ponylang
jemc has joined #ponylang
tm-exa has quit [Quit: Computer has gone to sleep]
tm-exa has joined #ponylang
trapped has quit [Ping timeout: 244 seconds]
tm-exa has quit [Quit: Computer has gone to sleep]
Matthias247 has quit [Read error: Connection reset by peer]
jemc has quit [Ping timeout: 244 seconds]
DaniR has joined #ponylang
<DaniR> Hello everyone. I have a question about Pony's initializers. Should I ask here?
<doublec> DaniR: yes, ask away
<DaniR> I don't understand when the tutorial says for classes " Functions may still be called on an object after its finalisation, but only from within another finaliser. Messages cannot be sent from within a finaliser."
<doublec> DaniR: which part don't you understand?
<DaniR> If finalisers are used for example to close files, you shouldn't be able to call a function that may try to read or write in that file
<doublec> I can't think of a way another object would call a function on a finalized object given that the finalizer is called where there are no references to that object.
<DaniR> Right. I can think of it either. I thought maybe I wasn't getting the point
<DaniR> Why would that be useful or when would it happen?
<doublec> I assume it's the case if the finalizer calls a method on another object, passing the finalized object to it
<doublec> then that other object can call methods on it
<doublec> Oh, "after its finalization"
<doublec> DaniR: hopefully someone else can clear it up for you
<DaniR> doublec: It's okay, thank you very much for answering :)
Fedee has joined #ponylang
<Praetonus> That bit is for cyclic object graphs. If you have two objects A and B referencing each other, one of them must be finalized before the other. If A is finalized first, B's finalizer will still be able to call functions on A because B holds a reference to A
<DaniR> But what happens if the function B calls from A needs, for example, a file that was closed in A finalizer ?
<Praetonus> You can raise an error or ignore the call. But since we're talking about finalizers, accessing a file at that moment would probably be a bad idea
<DaniR> Or functions in finalized objects don't do anything? Or does it mean that you can call the finalizer on a finalized object (which I guess won't do nothing)?
<DaniR> Probably is a bad idea and a bad example :P but I can't think of a use of that
Applejack_ has quit [Ping timeout: 250 seconds]
<DaniR> Maybe it's like you say for cyclic references, but I guess that the only function called from a finalized object would be the finalizer
<Praetonus> I wasn't around when it was designed like this, but I guess this is to simplify garbage collection. It would be really hard to manage finalization ordering with multiple objects referencing each other
<DaniR> Right. But I find it weird that it says it can call any function after finalized. Because ithen you should in every function you implement, guard yourself for errors (in trying to access a closed file for example) when maybe you just opened it in the constructor and close it in the finalizer
<DaniR> Nonetheless, I get that point of finalizing cyclic referencing objects.
<DaniR> Thank you :)
<Praetonus> In fact, ensuring consistent behavior after finalization isn't really hard in most case. For example, in stdlib File, read and write functions have a receiver capability of ref. Since a finalizer must have a receiver capability of box, you cannot call ref functions on a (potentially finalized) field. So you only have to worry about box functions and that's usually easy
<DaniR> You are right ! Thanks Praetonus. In the finalizer you may only call box functions and that probably solves these "issues"
<Fedee> Hi. I'm having difficulties installing pony on my laptop. I'm running Ubuntu Trusty and followed the steps on github, but I'm getting this error: "src/libponyc/codegen/genopt.cc:15:30: fatal error: llvm/IR/CallSite.h: No such file or directory #include <llvm/IR/CallSite.h>" when using the command "make config=release" for Pony. Any ideas on why this might be?
<SeanTAllen> which version of llvm Fedee? and how did you install it?
<Fedee> I just used apt-get install llvm-dev
<SeanTAllen> and which version of llvm does that install?
<Fedee> I think 3.6 (or so it says on pony's github) but if I do "which llvm-dev" it returns nothing.
<SeanTAllen> is there a llvm-config-* installed in your path?
<SeanTAllen> also where did you install llvm from? the llvm repo or from ubuntu's apt repo?
<SeanTAllen> if you didnt install from llvm repo http://llvm.org/apt/, try installing from there. that's the recommended way to install llvm.
<doublec> Fedee: I was able to install on trusty by installing llvm from the llvm repo as SeanTAllen recommends
<Fedee> Let me check
<Fedee> So, according to that link I need to add (deb http://llvm.org/apt/precise/ llvm-toolchain-precise main, AND deb-src http://llvm.org/apt/precise/ llvm-toolchain-precise main to my repostiry list) and then do apt-get install llvm-dev?
<Fedee> I've added those to /etc/apt/sources.list and ran apt-get update.
<Fedee> But if I try to install it llvm-dev it says it's already installed.
<SeanTAllen> if you are using trust, you would want to add the trusty links
<SeanTAllen> one of these:
<SeanTAllen> i take it, Fedee that installing from the LLVM apt repo wasn't clear and that we should work on clearing up that documentation? I'm assuming yes as I found it rather confusing and I know you need to install from the LLVM apt repo.
<Fedee> Okay, I added this to /etc/apt/sources.list:
<Fedee> deb http://llvm.org/apt/precise/ llvm-toolchain-precise main
<Fedee> deb-src http://llvm.org/apt/precise/ llvm-toolchain-precise main
<doublec> Fedee: this is what I added: http://pastebin.com/wHqdxqPT
<Fedee> Okay, I added that. purged the package llvm-dev package and re-installed it with apt-get install llvm-dev
<Fedee> I'm getting this error:
<Fedee> build/release/libponyc.a(codegen.o): In function `codegen_init': codegen.c:(.text+0xf9): undefined reference to `LLVMInitializeR600Target' codegen.c:(.text+0x141): undefined reference to `LLVMInitializeR600TargetMC' codegen.c:(.text+0x186): undefined reference to `LLVMInitializeR600TargetInfo' codegen.c:(.text+0x1cb): undefined reference to `LLVMInitializeR600AsmPrinter'
<SeanTAllen> Fedee if you are on Trusty, you shouldn't be using the Precise tools
<Fedee> I don't know what you mean by that.
<SeanTAllen> deb http://llvm.org/apt/precise/ llvm-toolchain-precise main is for Ubuntu Precide
<SeanTAllen> not Ubuntu Trusty
<SeanTAllen> this is for Ubuntu Trusty:
<SeanTAllen> deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty main
<SeanTAllen> deb-src http://llvm.org/apt/trusty/ llvm-toolchain-trusty main
Praetonus has quit [Quit: Leaving]
<Fedee> I'm getting the same error.
<SeanTAllen> can you detail what you've done, step by step please?
<Fedee> Yes, lets see.
<Fedee> First I did sudo apt-get install build-essential git \ zlib1g-dev libncurses5-dev libssl-dev wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-10.21.tar.bz2 tar xvf pcre2-10.21.tar.bz2 cd pcre2-10.21 ./configure --prefix=/usr make sudo make install Added this to /etc/apt/sources.list deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty main deb-src http://llvm.org/apt/trusty/ llvm-toolchain
<Fedee> Uf, sory, that has no line breaks, let me fix it
<Fedee> sudo apt-get install build-essential git \ zlib1g-dev libncurses5-dev libssl-dev
<Fedee> wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-10.21.tar.bz2
<Fedee> tar xvf pcre2-10.21.tar.bz2
<Fedee> cd pcre2-10.21
<Fedee> ./configure --prefix=/usr
<Fedee> make
<Fedee> sudo make install
<Fedee> The Added this to /etc/apt/sources.list
<Fedee> deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty main
<Fedee> deb-src http://llvm.org/apt/trusty/ llvm-toolchain-trusty main
<Fedee> sudo apt-get update
<Fedee> sudo apt-get install llvm-dev
<Fedee> make config=release
<Fedee> And then I get the error:
<Fedee> Linking ponyc
<Fedee> build/release/libponyc.a(codegen.o): In function `codegen_init':
<Fedee> codegen.c:(.text+0xf9): undefined reference to `LLVMInitializeR600Target'
<Fedee> codegen.c:(.text+0x141): undefined reference to `LLVMInitializeR600TargetMC'
<Fedee> codegen.c:(.text+0x186): undefined reference to `LLVMInitializeR600TargetInfo'
<Fedee> codegen.c:(.text+0x1cb): undefined reference to `LLVMInitializeR600AsmPrinter'
<Fedee> And that's it
<doublec> Fedee: You want: sudo apt-get install llvm-3.8-dev
<Fedee> I get Package llvm-3.8-dev is not available, but is referred to by another package.
<doublec> You'll need to remove the existing one you installed with llvm-dev
<doublec> Also use this in your sources.list: http://pastebin.com/wHqdxqPT
<doublec> It explicitly asks for 3.8
<doublec> When you've changed sources.list, do: wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|sudo apt-key add -
<doublec> Then: sudo apt-get update && sudo apt-get install llvm-3.8-dev
<Fedee> Gotta leave for the moment, but I'll try when I get home in a while. Thanks for all the help.
<Fedee> Actually, I found some time and tried that, and installed it, but it's still the same.
DaniR has quit [Quit: Page closed]
Fedee has quit [Ping timeout: 250 seconds]
<SeanTAllen> can you try removing all llvm's that you are aware of and try building, it should fail much earlier if you havent gotten rid of everything so taht you are starting over
gsteed has quit [Quit: Leaving]
<doublec> Also clean your ponyc build directory
<SeanTAllen> indeed