c355e3b has quit [Quit: Connection closed for inactivity]
jemc has joined #ponylang
<DanC_>
I'm trying to make a sort of stringbuilder...
<DanC_>
class MASTStream
<DanC_>
let _blocks: Array[Array[U8] val] ref = Array[Array[U8] val]
<DanC_>
and then I have
<DanC_>
fun push(data: Array[U8] val) =>
<DanC_>
_blocks.push(data)
<DanC_>
but the compiler is griping at me
<DanC_>
box is not a subtype of ref
<DanC_>
aha! got it. I need push to be fun ref
<DanC_>
now I have a ref and I want to send it to something as an iso
<DanC_>
maybe it can start as trn?
<DanC_>
I want to pop something off an array and send it
jemc has quit [Ping timeout: 268 seconds]
<DanC_>
aha! the thing in the array was ref
copy` has quit [Quit: Connection closed for inactivity]
jemc has joined #ponylang
graaff has joined #ponylang
jemc has quit [Ping timeout: 248 seconds]
DanC_ has quit [Ping timeout: 244 seconds]
DanC_ has joined #ponylang
tm-exa has joined #ponylang
trapped has joined #ponylang
tm-exa has quit [Quit: Computer has gone to sleep]
copy` has joined #ponylang
c355e3b has joined #ponylang
jemc has joined #ponylang
vpm has quit [Quit: co'o]
vpm has joined #ponylang
tm-exa has joined #ponylang
tm-exa has quit [Quit: Computer has gone to sleep]
Matthias247 has joined #ponylang
copy` has quit [Quit: Connection closed for inactivity]
jemc has quit [Read error: Connection reset by peer]
jemc has joined #ponylang
TwoNotes has joined #ponylang
Praetonus has joined #ponylang
copy` has joined #ponylang
tm-exa has joined #ponylang
<TwoNotes>
Do the String functions work properly with UTF8 coded Strings? It looks like not.
tm-exa has quit [Quit: Computer has gone to sleep]
Praetonus has quit [Quit: Leaving]
TwoNotes has quit [Quit: Leaving.]
graaff has quit [Quit: Leaving]
<SeanTAllen>
what does "work properly" mean?
TwoNotes has joined #ponylang
<TwoNotes>
Any thoughts on doing language localization in Pony?
<TwoNotes>
1. External "resource file" read into a Map at startup?
<TwoNotes>
2. Map initialized from a big Array literal at startup?
<TwoNotes>
The Map has to be in a val class so it can be shared
<TwoNotes>
3. Format of the resource file, needs embedded escapes for parameter substitution, pluralization
<SeanTAllen>
localization has a performance impact. people who don't need it shouldn't have it pay it. so it would need to be something that is optional via library.
<TwoNotes>
I agree with that.
<TwoNotes>
It is a royal pain to have to do it, but certain kinds of apps need to take it into account
<TwoNotes>
An advantage to using an Array literal is that it gets syntax-checked by the compiler. No additional tools required.
<TwoNotes>
Can a String hold UTF8 characters without problems, or is there a special class for that?
<TwoNotes>
An advantage to an external resource file is that you do not pay the cost of building the Map for all the languages that do not get used. But you have to be able to load them on demand.
<ohir>
SeanTAllen: I disagree. 'People who don't need l10n/l18n' are a tiny minority that just did not realised their needs yet
<TwoNotes>
Programmers are lazy and do not want to worry about it. But adding I18n after the fact is extremely time consuming.
<ohir>
TwoNotes: exactly
<TwoNotes>
But I agree that I do not expect a low-level function like StdStream.print() to have the I18n logic built into it
<ohir>
TwoNotes: I would expect it
<jemc>
ohir: many applications are not user-facing at all
<TwoNotes>
Because you have to worry about parameter substitution, out-of-order substitution, pluralization, etc, just in building up the string
<ohir>
TwoNotes: it would be a best selling point for the pony
<TwoNotes>
As I need it for my app, I will try a few ideas
<ohir>
jemc: nowadays 'user facing apps' are just thin layer of ui
<TwoNotes>
jemc, non-user-facing apps have to be maintained by customer support or sys admin people who might speak any of 2 dozen languages
<jemc>
TwoNotes: yes, String is UTF-32-aware, depending on which method you call you deal in codepoint indices rather than byte offsets
<jemc>
(to answer your earlier question)
<ohir>
jemc: any serious business band-aid patchworked app now needs to get at least latin scripts and three to four languages spoken in the corpo
<TwoNotes>
I used to write database upgrade tools. The entire user interface had to do I18N
<TwoNotes>
Including Japnese, Korean, and two flavbors of Chinese
<ohir>
jemc: the era of english spoken it ended somewhen at the millenia break
<jemc>
ohir: totally depends on your context - many companies still expect all their employees to speak english
<jemc>
(and don't outsource ops)
<ohir>
jemc: employees - yes. Customers - no
<jemc>
many companies never let their customers read stdout
<jemc>
(with regard to your comment about building into StdStream)
<TwoNotes>
Walk up to a clerk in a jewelry store in Geneva and the clerk behind the counter probably speaks 5 languages. I am working on a an app that has to do that
<ohir>
jemc: serious business is international from decade, my order form should not keep my bengali or georgian customer out of my prospect income
<TwoNotes>
Yes, I do not think StdStream is the place for this. But in a library package above all that
<jemc>
I have no doubt that many apps need to be internationalized - I'm merely arguing against ohir's assertion that *all* apps need it
<TwoNotes>
be back in a sec
TwoNotes has quit [Quit: Leaving.]
<ohir>
jemc: StdStream likely not, but with incumbent language we might get it right, or at least deep
<ohir>
jemc: almost all
<jemc>
we may just be talking about different problem domains
TwoNotes has joined #ponylang
<jemc>
I mainly tend to deal with problem domains that are far, far away from the UX of a product
<ohir>
jemc: ok, some number cruching middleware need not, but the chart I would like to describe in customer's native language
<ohir>
jemc: so am I, but I for many years served as business-it translator, and business people taught me i18n importance
<jemc>
TwoNotes: I'm not saying an internationalization package shouldn't exist - I think it sounds like I don't disagree with any of your points so far
<TwoNotes>
I am saying it should be an optional library, but it would be nice if there was just one
<ohir>
jemc: it would be good for the pony to get i18n deep into runtime, imo. Doing it as 'packages' is steeping into past wrongers toes ;)
<jemc>
ohir: well, you're barking up the wrong tree talking to me with that argument :) - in my opinion, a large chunk of what is now in the standard library should be jettisoned into third-party packages once we have a package manager
<ohir>
jemc: e.g. all statically compiled strings should be grouped into a segment that can be on the fly substituted by other set that came from 'a resource file'
<jemc>
that is, the language should just be a language, and packages should be replaced/obseleted freely based on merit and popularity instead of some core devs deciding what to ship and what not to ship
<jemc>
but I know not everyone feels as I do
<ohir>
jemc: it of course cost at least one level of additional indirection in all progs
<ohir>
jemc: I agree with modularity attitude
<jemc>
ohir: I bet you could something close to that kind of behavior using ifdefs in a pony package
<ohir>
jemc: just some things cannot be. I18n is one of such.
<ohir>
jemc: ya know, no T(), no Istr{} and likes
<ohir>
jemc: I wanna "this string" printed/emitted as "ten łańcuch" if the env says PL_pl
<ohir>
jemc: and my 'resource' comes with such locale
<jemc>
ohir: probably the best way to do that in a modular way is with some sort of AST preprocessor plugin system -something I am working on for other reasons
<TwoNotes>
An app has to be able to do multiple languages at once, in different user "sessions"
<jemc>
that is, you write a plugin that gets passed the program AST and scans/replaces string literals before handing off the AST to the next pass of the compiler
<TwoNotes>
And change on the fly, like that clerk in the jewelry store
<ohir>
jemc: nope, its something that only runtime can do both well and fast
<TwoNotes>
This sounds like an area where different ideas will have to be tried out and see which is popular
<ohir>
jemc: my prog need to speak all languages I/my customers use (I provide text segments for)
<jemc>
ohir: okay, I think I'm getting nowhere with talking to you about this - with respect, I'm going to stop this conversation and get back to other work
<ohir>
jemc: ok, thanks for disagreeing poolitely
<ohir>
jemc: we'll back to i18n discussions in the future, I hope :)
<jemc>
sure, adn thanks for your civility as well :)
<ohir>
and good night (here) day (there), bbvl
Matthias247 has quit [Read error: Connection reset by peer]
trapped has quit [Read error: Connection reset by peer]