dynarr has quit [Quit: A merry Christmas to all, and to all a good night!]
dynarr has joined #ponylang
montanonic has quit [Ping timeout: 265 seconds]
<polypus74>
anybody have any advice on parsing a binary wire format. blog posts, libraries to use or peruse, goodies in the standard lib, tips?
<polypus74>
on a side note, has binary pattern matching a la erlang ever cropped up as a possibilty in pony?
<jemc>
polypus74: I've been working a bit on developing some generalized patterns for composable binary codecs, but I personally don't have anything concrete to give or talk about yet
<polypus74>
anything ephemeral then :), a github repo?
<polypus74>
just to study
<jemc>
eh, not really at the moment, sorry
<polypus74>
np. good luck with it
<jemc>
my pony-zmq repo is a decent example, the standard library openssl is a decent example, but neither are as generalized as I would like
<jemc>
err... meant "ssl", not "openssl"
<polypus74>
that's great though just to have a look at how people have done it. thanks
<polypus74>
jemc: i see you have some files containing private stuff starting with underscore. is that just a convention or does the compiler treat them differently?
<jemc>
no compiler difference
<jemc>
it's a convention I find to be really valuable, and the stdlib adopted it as well
dynarr has quit [Quit: A merry Christmas to all, and to all a good night!]
montanonic has quit [Ping timeout: 244 seconds]
dynarr has joined #ponylang
<dynarr>
i've noticed i get an error when local variable names start with _; is that unrelated to the private field convention?
<SeanTAllen>
no
<SeanTAllen>
local variables can't start with _
<SeanTAllen>
its directly related to the private field naming
<SeanTAllen>
_ indictes private which doesn't make sense for locals
<polypus74>
dynarr: i was talking about file names starting with _. you mentioned 'convention' so just making sure
<polypus74>
jemc: ty for pointer
<dynarr>
ohhh, okay. i mentally substituted "fields" for "stuff", so i thought you were talking about private fields. good to know i wasn't completely imagining compiler support for that...
montanonic has joined #ponylang
<jemc>
ah, sorry to be confusing folks - the file naming is a convention for aligning with the compiler-enforcement of leading `_` as an indicator of private
<polypus74>
are there character literals?
<jemc>
polypus74: yes, it's single quotes just as in C
<polypus74>
doh. i tried that, it didn't work, but it was an rcap error. thanks
<dynarr>
if i have a primitive that has a `fun apply() => Array[String val] val` with an array literal containing string literals... will the array be statically allocated, as opposed to allocated every time i "call" the primitive?
<dynarr>
and is there a more idiomatic way to have a static array of static strings?
<SeanTAllen>
can you gist that just so i am positive i am understanding you correctly dynarr ?
<jemc>
dynarr: if I understand you correctly, there is no more idiomatic way in pony, as there are no "constants", and we simulate the concept with primitive functions, as you seem to have gleaned
<jemc>
as far as how that comes out in the compiled executable, it's an optimization/compiler issue, and I'm not totally certain how "good" we are on that kind of example yet
<jemc>
Praetonus or sylvanc would be most likely to know those details, and I would be interested to know them too
<jemc>
however, my initial guess would be that the array literal would be newly allocated each time (which I know isn't the answer you or I want to hear)
<jemc>
because the compiler translates array literals to code like: `Array[String].create(3).push("foo").push("bar").push("baz")`
<jemc>
so we'd have to be doing some sophisticated LLVM magic to see that as a constant value
<SeanTAllen>
as far as my understanding goes in this area, jemc is correct
<jemc>
also, I think there is a "pedantic correctness" issue at play here
<SeanTAllen>
?
<jemc>
that is, assuming yout primitive `Foo` with `fun apply() => Array[String val] val`, what should be the result of the expression `Foo.apply() is Foo.apply()`?
<jemc>
pedantically, I'd say it should be `false`, since you're creating and returning a new `Array` each time
<jemc>
but for this purpose of emulating a constant, we "want" it to be `true`
polypus74 has quit [Remote host closed the connection]
<SeanTAllen>
it currently is false
<SeanTAllen>
i wonder what happens with Vectors in Luke work...
<jemc>
it's also `false` for string literals, which is a bit more surprising, considering they are all created as `val` and are stringtabbed
<SeanTAllen>
yeah that was the Map.upsert bug I fixed
<SeanTAllen>
well, its how i found it
<SeanTAllen>
an RFC to add actual constants would be very nice
<dynarr>
interesting. i wouldn't have thought of that "pedantic correctness" issue at all. thanks for giving me a better understanding of how this code works! i'll definitely participate, or at least follow along, on that RFC...
<jemc>
though, for string literals, the following *is* true: `primitive Foo fun apply(): String => "foo"`, `Foo().cstring() is Foo().cstring()`
<jemc>
that is, the underlying pointer (`cstring`) is the fixed pointer to the data portion of the program
<jemc>
maybe we could do the same for `Array` literals, with a little bit of magic?
<jemc>
well, I guess the problem is that `Array` literals are created as `ref` (mutable), so its a different case from the `String` literals (created as `val`)
<jemc>
SeanTAllen: a while back we discussed in this channel the idea of having the compiler try to understand/prove functions that could be memoized, which is perhaps a related problem
<dynarr>
right
<dynarr>
the whole reason i brought this up was the "recover val" bit felt wrong for a "constant"
<jemc>
dynarr: perhaps a case could be made that array literals should be val, just like string literals
<jemc>
making you clone them if you wanted a mutable copy
<jemc>
though, I suppose that breaks down if you want to create an array literal of mutables...
<jemc>
perhaps the immutable array literal needs its own syntax?
<jemc>
(which could only syntactically contain other literals, and not, say local references to other objects)
<jemc>
this would allow it to be "stringtabbed" in a similar way to how strings are
<SeanTAllen>
i'd be more interested in a way to say "this thing, is an immutable singleton aka constant"
<SeanTAllen>
so i could have this work with any data structure
<jemc>
SeanTAllen: that's true, it would be more useful if it worked for other classes and such
<jemc>
SeanTAllen: essentially, we might be coming back full circle to Luke's work on value-dependent types
<SeanTAllen>
true
<jemc>
in which he introduced the concept of compile-time values, which may be complex
<SeanTAllen>
it would be great to ask him but according to sylvan, he is without internet access til the 22nd or 23rd
<jemc>
I've played a bit with his fork, trying to flesh out various ideas about using compile-time value expressions in the context of a more convenient API for JSON parsing into data structures
<jemc>
so far nothing great has come out of that play, but I think I'll revisit it soon with this conversation in mind
<jemc>
(nothing great in terms of JSON API ideas, I mean)
<SeanTAllen>
i stopped playing around with JSON stuff when I realized that the type system currently forces you to use JsonArray because of issues with circular union types :(. That's one I need to return to. Not that its related but I do want to return to it.
<SeanTAllen>
anyway... bedtime for me. ttyl.
<jemc>
SeanTAllen: yeah, came to the same problem when I was working on a messagepack library - in fact messagepack was worse, since the keys of maps can be any type, not just strings
<jemc>
I ended up going a route of a more lazy, caller-participatory parsing experience instead of the eager "parse it all into one big data structure" approach
dynarr has quit [Quit: A merry Christmas to all, and to all a good night!]
dynarr has joined #ponylang
mcguire has quit [Ping timeout: 240 seconds]
amclain has quit [Quit: Leaving]
rosstuck has joined #ponylang
rosstuck has quit [Ping timeout: 240 seconds]
dynarr has quit [Quit: A merry Christmas to all, and to all a good night!]
rosstuck has joined #ponylang
pyon has quit [Quit: Fix config.]
pyon has joined #ponylang
montanonic has quit [Ping timeout: 250 seconds]
montanonic has joined #ponylang
dinfuehr has quit [Ping timeout: 276 seconds]
dinfuehr has joined #ponylang
Matthias247 has joined #ponylang
_andre has joined #ponylang
montanonic has quit [Ping timeout: 265 seconds]
jemc has quit [Ping timeout: 244 seconds]
Matthias247 has quit [Read error: Connection reset by peer]
rosstuck has quit [Ping timeout: 244 seconds]
<ericbmerritt>
I have been consistently moving away from parsing json into datastructures. It tends to encourage you to use your protocol layout for the business and encourages coupling among other problems. For awhile now in languages that have a reasonable types system been using lenses or variations on lenses to pick out what I need. I have been rolling around in my
<ericbmerritt>
head a mix of declarative descriptions that generate a set of lazy accessors so I can have strong typing in json without giving up loose coupling. That doesn't change the problems you guys are having, but it caused me to think about it
jemc has joined #ponylang
Praetonus has joined #ponylang
M-hrjet has quit [Remote host closed the connection]
srenatus[m] has quit [Remote host closed the connection]
M-Ingo has quit [Write error: Connection reset by peer]
emancu has joined #ponylang
amclain has joined #ponylang
Praetonus has quit [Quit: Leaving]
Perelandric has joined #ponylang
<Perelandric>
Just updated from master and can no longer build because stdatomics.h is missing...
<Perelandric>
Hightest GCC that LinuxMint 17 has is 4.8...
<Perelandric>
Does have Clang 3.8 though...
<Perelandric>
So do I need to compile ponyc with that? If so, how would this be done?
Praetonus has joined #ponylang
srenatus[m] has joined #ponylang
dynarr has joined #ponylang
M-hrjet has joined #ponylang
M-Ingo has joined #ponylang
montanonic has joined #ponylang
<SeanTAllen>
Praetonus: any idea on Perelandric's issue?
<SeanTAllen>
Perelandric: i believe that gcc 4.6 works but that is based purely on what malthe said
<SeanTAllen>
Perelandric: apparently there was a bug and it isnt in til 4.9
<SeanTAllen>
so it was supposed to be in 4.7 and 4.8 but wasnt because... ooops
<SeanTAllen>
can you use clang Perelandric ?
<Perelandric>
SeanTAllen: Thanks, I can use Clang but don't know how to get `make` to use it instead of GCC.
<Perelandric>
...haven't had time to research it yet. I'll take a minute right now.
<SeanTAllen>
there's some environment variable i believe
<SeanTAllen>
I believe its CC that you should be able to set
<Perelandric>
Yes, I tried setting CC and CXX, but no-go. I'll keep searching.
<SeanTAllen>
yeah its CC
<SeanTAllen>
CC works for me
<SeanTAllen>
i did export CC="whatever"
<SeanTAllen>
and that worked
<Perelandric>
Strange. I did `export CC="/usr/bin/clang-3.8` and verified with `$CC --version`, but no luck.
<SeanTAllen>
that's odd
<SeanTAllen>
I take it the RPMs wont work on Mint?
<SeanTAllen>
Mint is RPM based right?
<Perelandric>
Mint is deb.
<Perelandric>
It has the older GCC without the stdatomics.h, but has the right Clang.
<Perelandric>
I'll keep working on it. If I don't have it by tomorrow, I'll bug you guys about it then. ;-)
<Perelandric>
Thanks for the help!
<SeanTAllen>
ok
<SeanTAllen>
thanks
<Perelandric>
Hardcoding the `CC` variable in the Makefile works for now...
<Perelandric>
I notice that `ponyc -v` still gives a `0.2.1...` version even though I'm pulling from upstream/master
<Perelandric>
I wonder if there are some variables cached somewhere/somehow that are using the old CC path and pony version number.
fusta has joined #ponylang
<SeanTAllen>
Carl reported that on the mailing list and then I think fixed it
<SeanTAllen>
I was unable to reproduce
<SeanTAllen>
O right
<SeanTAllen>
it was because he was still checked out on the tag or something
<SeanTAllen>
check the mailing list
fusta has quit [Quit: Leaving]
<Perelandric>
I see that when `.git` is present, it gets the version number from `git describe --tags --always`
<Perelandric>
...instead of from the VERSION file.
<Perelandric>
I see `git tag` has 0.2.1 as the most recent tag.
<SeanTAllen>
that might be suboptimal
<SeanTAllen>
awesome within a version to have the commit
<SeanTAllen>
not so much to get the version from there
<SeanTAllen>
could you open an issue for that?
<Perelandric>
SeanTAllen: Yes, I'll open an issue in a bit.
<Perelandric>
I see that the tags are up to date when viewed from github.
<Perelandric>
I must not be keeping my local sync'd properly.
<Perelandric>
`git fetch --tags upstream` took care of that.
_andre has quit [Quit: leaving]
k0nsl has quit [Ping timeout: 265 seconds]
k0nsl has joined #ponylang
montanonic has quit [Ping timeout: 244 seconds]
montanonic has joined #ponylang
_whitelogger has joined #ponylang
mitchellvanw has joined #ponylang
otremblay has joined #ponylang
darach has joined #ponylang
cquinn has joined #ponylang
Matthias247 has joined #ponylang
Praetonus has quit [Quit: Leaving]
bbhoss has quit [Ping timeout: 265 seconds]
bbhoss has joined #ponylang
Matthias247 has quit [Read error: Connection reset by peer]