<fdemilde>
I've got some beginner's questions regarding pony
<fdemilde>
How are constructors called? (e.g. the Wombat class of the getting started tutorial)
<fdemilde>
Would that be the <className>.<constructorName>? Or rather <className>(...,...,...) so providing the class name with the correct set of arguments?
<fdemilde>
Apparently it would be <className>.<constructorName>(...,....,...)
vrand has quit [Remote host closed the connection]
vrand has joined #ponylang
vrand has quit [Client Quit]
vrand has joined #ponylang
amclain has joined #ponylang
runehog has quit [Remote host closed the connection]
mcguire1 has joined #ponylang
runehog has joined #ponylang
<vrand>
I've been trying to work through exercism.io's Pony track. I've been working on the "difference of sums" problem but I'm running into a few problems so I created a standalone program to work out the logic — https://gist.github.com/vrand/c02267f5a940c0f4fbb401b87ea0c996
<vrand>
The problem I'm running into is that the sum_of_squares and square_of_sums functions seem to return "None"
<vrand>
When I print the values from within the function I get the correct output but when I print the values from the returned functions in Main I get "None"
<vrand>
Subsequently I have have a problem with line 44 (the commented out difference) function. If uncommented, Ponyc complains that "couldn't find 'sub' in "None""
<vrand>
and my limited Pony knowledge is preventing me from understanding why
<Praetonus>
vrand: You have to specify the return type of your functions
<Praetonus>
For example, fun sum_of_squares(): U32
<vrand>
Oh!
<Praetonus>
By default, a function returns None
<vrand>
Oh my…
<vrand>
*facepalm*
<vrand>
I was so stuck on making sure my algo was right. Well thanks :-$
travisgriggs has joined #ponylang
travisgriggs has quit [Remote host closed the connection]
travisgriggs has joined #ponylang
<travisgriggs>
could/should pony be used for embedded C environments. I’ve got a round of 32bit arm development to do, i get tired of doing it in raw C with atmels “help the hobbyist” frameworks
<Praetonus>
travisgriggs: Pony requires its runtime library to run, so it depends on your environment. If you can use static libraries there should be no problem
<travisgriggs>
have people used it in a cross compiler manner yet? IOW, if I have the arm-gcc toolchain installed, will ponyc wrap around that and use that to build a binary for my arm target?
<Praetonus>
You can specify a target arch and a linker with compiler flags
bbhoss has quit [Ping timeout: 250 seconds]
ericbmerritt has quit [Ping timeout: 258 seconds]
NhanH has quit [Ping timeout: 250 seconds]
jeremyheiler has quit [Ping timeout: 250 seconds]
adamkittelson has quit [Ping timeout: 250 seconds]
_andre has quit [Quit: leaving]
NhanH has joined #ponylang
bbhoss has joined #ponylang
ericbmerritt has joined #ponylang
jeremyheiler has joined #ponylang
adamkittelson has joined #ponylang
TwoNotes has joined #ponylang
TwoNotes has quit [Quit: Leaving.]
c355e3b has quit [Quit: Connection closed for inactivity]
runehog has quit [Remote host closed the connection]
vrand has quit [Quit: Leaving.]
<doublec>
travisgriggs: the pony compiler has hard coded things for the platform your building on unfortunately
<travisgriggs>
thanks doublec. i hoped it was more of a wrapper around gcc, so one could just change the wrapped toolchain. sounds like it is a bit more of a proper compiler than that
<jemc>
travisgriggs: yeah, ponyc constructs LLVM IR, then uses the LLVM toolchain to compile native code for your target triple
<jemc>
so, gcc (or even clang) isn't really involved in the process at all
<jemc>
(except in building the ponyc compiler to start with)
<jemc>
ponyc also has a flag for outputting LLVM IR instead of a native library/executable
<jemc>
so you could also experiment with an approach of getting your hands on that output LLVM IR, then feeding it into a cross-compile toolchain for clang
<jemc>
however, not sure if there are other hurdles you might encounter with that approach
<travisgriggs>
i think i’ll just play with it on a linux platform. i don’t do a lot there lately, doing more on-the-arm-firmware these days. i only just read through the tutorial (even though it’s more of a manual than a tutorial) today, so i’m sure i’ll have enough hurdles to surmount
<jemc>
yeah, if you're just learning the language, it's probably best to get used to it and be sure you like it first :)
bbhoss has quit [Ping timeout: 255 seconds]
ericbmerritt has quit [Ping timeout: 258 seconds]
NhanH has quit [Read error: Connection reset by peer]
adamkittelson has quit [Ping timeout: 250 seconds]
jeremyheiler has quit [Ping timeout: 260 seconds]
runehog has joined #ponylang
adamkittelson has joined #ponylang
omarkj_ has joined #ponylang
gornikm has quit [Read error: Connection reset by peer]
gornikm has joined #ponylang
omarkj has quit [Ping timeout: 244 seconds]
omarkj_ is now known as omarkj
jeremyheiler has joined #ponylang
bbhoss has joined #ponylang
jeremyheiler has quit [Remote host closed the connection]
adamkittelson has quit [Remote host closed the connection]
bbhoss has quit [Remote host closed the connection]