Enlightened


  • Banned

    @dfdub said in Enlightened:

    @gąska said in Enlightened:

    It's impossible to translate most format strings either. Either you make your translation tools to account for huge grammar differences between languages - especially in how quantities work - or you end up with your entire program being like "the number of unread emails you have in your mailbox is 2."

    Now you're just arguing that printf should support format strings that reference arguments by index (like other languages do) and you're absolutely right.

    Even that's not enough. You need a lot of bonus code for your string formatting if you're doing translations than if you're doing just one language. Let's say, you have a game dialogue where the protagonist can be male or female. How will you handle the resulting text changes? In English, you have just pronouns to care about; in other European languages, there's much more.

    But having a regular format string is already much better than having nothing coherent at all.

    Agreed. I choose to use printf over cout myself, though the biggest reason isn't readability or translability, but statelessness. "%d" is always base 10 and float precision is right there in format string.



  • @gąska said in Enlightened:

    @dfdub said in Enlightened:

    @gąska said in Enlightened:

    It's impossible to translate most format strings either. Either you make your translation tools to account for huge grammar differences between languages - especially in how quantities work - or you end up with your entire program being like "the number of unread emails you have in your mailbox is 2."

    Now you're just arguing that printf should support format strings that reference arguments by index (like other languages do) and you're absolutely right.

    Even that's not enough. You need a lot of bonus code for your string formatting if you're doing translations than if you're doing just one language. Let's say, you have a game dialogue where the protagonist can be male or female. How will you handle the resulting text changes?

    Yeah, my biggest issue with gettext is that it handles plural forms so well and then completely ignores this problem. But I guess that's because some languages go completely crazy (e.g. grammar depends on whether someone is a relative or not), so the developers just said "fuck it, not my job" after the initial research.


  • Java Dev

    @dfdub said in Enlightened:

    @dkf said in Enlightened:

    It usually seems to be written by people who feel that they need to take a stand on preventing the great vowel shortage, and to keep identifiers as short as possible.

    According to rumors (I haven't checked), one of our products has a huge C code base in which no variable name is longer than 8 characters due to some bug in the only compiler for some weird architecture we have to support. I am not planning on ever touching that repository.

    That's not a bug, it matches the spec. C89 I think. Longer names are a later extension.


  • Discourse touched me in a no-no place

    @gąska said in Enlightened:

    It's impossible to translate most format strings either.

    It's not quite as bad as that; the key is that good string formatters don't need to consume the arguments in order and can apply word pluralisation rules (from the localisation). Which is a bit messy, but works. Baking in the order of arguments totally makes things impossible.


  • Discourse touched me in a no-no place

    @pleegwat said in Enlightened:

    That's not a bug, it matches the spec. C89 I think. Longer names are a later extension.

    It held for systems that used very old linkers. Horrible environments to work in. :(



  • @dfdub said in Enlightened:

    While I agree with the title of this video, I very much disagree with the slide that says teaching people to write cout << "Hello " << myVar; is okay. No, people should learn format strings from the start, because it's impossible to translate programs that don't use format strings for everything.

    The problem is C++ does not have (type-safe) format strings in the standard library. It only has the one it inherited from C and that is not particularly good for translation either, because its arguments are positional rather than named.

    @cvi said in Enlightened:

    the proposals regarding formatting

    Yeah, still proposal. At least there is the Boost not-exactly-equivalent implementation.

    @gąska said in Enlightened:

    Either you make your translation tools to account for huge grammar differences between languages - especially in how quantities work - or you end up with your entire program being like "the number of unread emails you have in your mailbox is 2."

    There is a couple of well tested and proven translation tools that do.

    Unfortunately many programmers underestimate the issue and cook their own. Then that's exactly what they get.



  • @bulb said in Enlightened:

    Yeah, still proposal. At least there is the Boost not-exactly-equivalent implementation.

    AFAIK, the proposal is based on this library on github. Haven't used it (I included tinyformat into my code some time ago; waiting for the proposal to go anywhere before I consider switching).

    Either way, the implementation on github should match the proposal, and has no other dependencies (so, no dragging around boost just for printing stuff).


  • BINNED

    @cvi said in Enlightened:

    AFAIK, the proposal is based on this library on github

    Looks just like the python format function, which is nicer than either cout or printf.

    And hooooly crap, look at that Boost Format benchmark. These guys really deliver on over-complicated, slow to compile, and huge code size. At least it doesn't seem to be quite as hard to use as some other boost libraries.



  • @pleegwat said in Enlightened:

    @dfdub said in Enlightened:

    @dkf said in Enlightened:

    It usually seems to be written by people who feel that they need to take a stand on preventing the great vowel shortage, and to keep identifiers as short as possible.

    According to rumors (I haven't checked), one of our products has a huge C code base in which no variable name is longer than 8 characters due to some bug in the only compiler for some weird architecture we have to support. I am not planning on ever touching that repository.

    That's not a bug, it matches the spec. C89 I think. Longer names are a later extension.

    No, the C89 spec was SIX characters for external linkage, and not case sensitive either, I think because of the same antiquated(1) linker that left us with all the C standard library names being six characters or shorter.

    (1) Antiquated in 1989, that is. These days I think it's probably better to call it "fossilised".



  • @gąska said in Enlightened:

    @dfdub said in Enlightened:

    @gąska said in Enlightened:

    It's impossible to translate most format strings either. Either you make your translation tools to account for huge grammar differences between languages - especially in how quantities work - or you end up with your entire program being like "the number of unread emails you have in your mailbox is 2."

    Now you're just arguing that printf should support format strings that reference arguments by index (like other languages do) and you're absolutely right.

    Even that's not enough. You need a lot of bonus code for your string formatting if you're doing translations than if you're doing just one language. Let's say, you have a game dialogue where the protagonist can be male or female. How will you handle the resulting text changes? In English, you have just pronouns to care about; in other European languages, there's much more.

    It's not just pronouns that cause issues. In French, the possessive adjectives (my, your, his, her, its, our, their)(1) don't change for the grammatical gender of the owner: there is no difference between "his book" ("son livre") and "her book" ("son livre"), but they do change for the gramgender of the owned thing: "his turn" = "son tour", "his tower" = "sa tour"...

    (1) Possessive pronouns are words like mine, yours, his, hers, its, ours, and theirs. In French, these also ignore the owner's gramgender, but follow the owned's instead. "le mien" = "mine" for my masculine thing, "la mienne" = "mine" if it's feminine.


  • Banned

    @steve_the_cynic said in Enlightened:

    gramgender

    I hate you.



  • @pleegwat said in Enlightened:

    That's not a bug, it matches the spec. C89 I think. Longer names are a later extension.

    TIL. Doesn't make the situation any better, though. I really don't want to write C code unless absolutely necessary (I'm a huge fan of C++ myself) and I definitely don't want to be restricted to an old version of the C standard if I do.


  • Discourse touched me in a no-no place

    @steve_the_cynic said in Enlightened:

    No, the C89 spec was SIX characters for external linkage

    I thought it was seven (because C symbols were invisibly prefixed with _ for bonus fun) but 6 would be believable too. I recommend that anyone insists on using such an ancient linker be told to go take a long walk of a short pier.



  • @pleegwat said in Enlightened:

    @dfdub said in Enlightened:

    @dkf said in Enlightened:

    It usually seems to be written by people who feel that they need to take a stand on preventing the great vowel shortage, and to keep identifiers as short as possible.

    According to rumors (I haven't checked), one of our products has a huge C code base in which no variable name is longer than 8 characters due to some bug in the only compiler for some weird architecture we have to support. I am not planning on ever touching that repository.

    That's not a bug, it matches the spec. C89 I think. Longer names are a later extension.

    Huh. TIL. I'm really surprised I haven't encountered that then, since I spend a lot of time in C-land, though I'm mostly in Windows and Linux and another engineer handles the weird, quirky compilers for strange systems.



  • @dkf said in Enlightened:

    I recommend that anyone insists on using such an ancient linker be told to go take a long walk of a short pier.

    You'll get no argument from me on that, for sure.


  • area_pol

    @dkf said in Enlightened:

    I thought it was seven (because C symbols were invisibly prefixed with _ for bonus fun) but 6 would be believable too. I recommend that anyone insists on using such an ancient linker be told to go take a long walk of a short pier.

    If anyone needs to use this compiler, they can make a preprocessor that maps the function names into the 7-character space (akin to JS minifiers). Problem solved, unless you have more than num_ASCII_alphanumerics^7 functions.


  • Discourse touched me in a no-no place

    @adynathos 627 = 3521614606208 (where 62 = 26 + 26 + 10) so we'll be fine for a while.

    I vaguely remember the NAG numeric library way back in the day did something almost exactly like this. It was awful. :(


  • BINNED

    @gąska said in Enlightened:

    @steve_the_cynic said in Enlightened:

    gramgender

    I hate youFrench.

    FTFY


  • area_pol

    @magus said in Enlightened:

    One of the fun things at Build 2018 was the announcement that Samsung is highly dedicated to .NET and Xamarin, and will fully support it in Tizen.

    This thread had something to do with that at some point, I think?

    Yes, Samsung planned to make a c# wrapper over efl. I don't remember how that abomination ended up, but hopefully impaled on a tree trunk.



  • @neighborhoodbutcher They're still going all-out on C# as of two weeks ago, but whether or not that interacts with efl still is not something I know.


  • area_pol

    @neighborhoodbutcher said in Enlightened:

    Yes, Samsung planned to make a c# wrapper over efl. I don't remember how that abomination ended up, but hopefully impaled on a tree trunk.

    Maybe it is still not crashing enough for their taste.



  • @dfdub said in Enlightened:

    @boomzilla said in Enlightened:

    I'm always amazed at how many standards readers we have on here.

    Some language standards can be surprisingly readable. C++, of course, is not one of those languages…

    Do you mean the C++ language standard is unsurprisingly readable? :trollface:

    I know I'm a weirdo because I always look at the official documentation for answers (I never copy from SO without looking up the official document and double-checking whether the answer is correct), but I honestly think that everyone should at least try to do that most of the time.

    I never* copy from SO without understanding what the code snippet is doing, regardless of the documentation, although sometimes that helps. :P

    * unless it has a note saying something like "yeah, we don't understand it either; no one really does; it just works."


  • Java Dev

    @adynathos said in Enlightened:

    @dkf said in Enlightened:

    I thought it was seven (because C symbols were invisibly prefixed with _ for bonus fun) but 6 would be believable too. I recommend that anyone insists on using such an ancient linker be told to go take a long walk of a short pier.

    If anyone needs to use this compiler, they can make a preprocessor that maps the function names into the 7-character space (akin to JS minifiers). Problem solved, unless you have more than num_ASCII_alphanumerics^7 functions.

    Part of the oracle C api works the other way round - documented names #defined to much shorter actual names.


  • Banned

    @dfdub said in Enlightened:

    I'm a huge fan of C++ myself

    Weirdo.



  • @gąska said in Enlightened:

    @dfdub said in Enlightened:

    I'm a huge fan of C++ myself

    Weirdo.

    Stockholm Syndrome.


  • BINNED

    @lb_ said in Enlightened:

    @gąska said in Enlightened:

    @dfdub said in Enlightened:

    I'm a huge fan of C++ myself

    Weirdo.

    Stockholm Syndrome.

    Wouldn't it be Copenhagen Syndrome?



  • @onyx Sure but I'm too lazy to change the title of my thread.


  • Considered Harmful

    @steve_the_cynic Wow, that is much less fun than Spanish. In Spanish there's just no gendered verbs at all.


  • 🚽 Regular

    @pie_flavor said in Enlightened:

    @steve_the_cynic Wow, that is much less fun than Spanish. In Spanish there's just no gendered verbs at all.

    Those aren't gendered verbs, they're gendered pronouns. This happens in all Romance languages. [citation needed].


  • Considered Harmful

    @zecc said in Enlightened:

    @pie_flavor said in Enlightened:

    @steve_the_cynic Wow, that is much less fun than Spanish. In Spanish there's just no gendered verbs at all.

    Those aren't gendered verbs, they're gendered pronouns. This happens in all Romance languages. [citation needed].

    Whoops, misread. But the possessives aren't gendered either, except for 'our' (nuestro(s)/nuestra(s)) which wouldn't really have anything other than the object to be gendered by.



  • @zecc said in Enlightened:

    @pie_flavor said in Enlightened:

    @steve_the_cynic Wow, that is much less fun than Spanish. In Spanish there's just no gendered verbs at all.

    Those aren't gendered verbs, they're gendered pronouns. This happens in all Romance languages. [citation needed].

    While French is indeed considered a very romantic language, I think you meant "Romanic".


  • Banned

    @rhywden no, "Romance" is correct in this context.


  • Resident Tankie ☭

    Romance languages are basically languages strongly related to Latin (namely, Italian, French, Spanish, Portuguese, Romanian and other regional languages such as Catalan). FWIW, possessive adjectives and pronouns depend on the gender of the object and not the owner in Italian too.

    I don't even know why I actually registered to reply to this on a three year old thread. I might as well say that EFL had been treated a bit too harshly for what it is (a hacker's tool written by a classic old-school hacker to scratch his own itch, who cares fuck all if the users take issue with being called a BEEEATCH!). It's the product of a culture where the most important metric is/was raw performance, not stability, not readability, not even security. Understandable and even exciting in the '90s. Out of place in 2015 (let alone 2018)? I suppose so, although Tizen targets real POS hardware and a barebones framework may have its merits... I mean, maybe Samsung doesn't even care if devs actively want to develop for Tizen, after all it's going on their smartwatches and fridges and TVs, as long those that must actually provide apps, namely Netflix, Hulu, the fitness crowd, etc. they're going to be OK. I doubt the Amazon Video (or whatever it's called) devs are going to pale and go all "god please no" when instructed to write their app anyway. Actually they might, but that's what they are paid for :smiling_face_with_open_mouth:


  • Banned

    @admiral_p I really doubt doing Tizen right would significantly reduce performance. And even if idiomatic code would be too slow, you can make your code both very performant and relatively sane with just a little extra effort. And I'm pretty sure that even in the 90s, profanities in error messages were a huge no-no, and the only reason the original developer wasn't fired on the spot is because the management didn't understand English.

    And welcome to the forum!


  • area_pol

    @admiral_p the problem is, this "hacker" who wrote EFL actually believes that it's a great piece of software, and he's some kind of programming guru. And, given Samsung managers are idiots, they naturally adopted it.

    @admiral_p said in Enlightened:

    I suppose so, although Tizen targets real POS hardware and a barebones framework may have its merits...

    If by POS you mean "piece of shit", rather than "point of sale", then your sentence is right.


  • Banned

    Oh great, now I'm getting upvotes on post I don't even remember writing! I hate when people bump ancient topics.


  • kills Dumbledore

    @dkf said in Enlightened:

    @adynathos 627 = 3521614606208 (where 62 = 26 + 26 + 10) so we'll be fine for a while.

    I vaguely remember the NAG numeric library way back in the day did something almost exactly like this. It was awful. :(

    IIRC, identifiers can't start with a digit so it's 52x626


  • ♿ (Parody)

    @gąska said in Enlightened:

    And I'm pretty sure that even in the 90s, profanities in error messages were a huge no-no, and the only reason the original developer wasn't fired on the spot is because the management didn't understand English.

    It started as an open source project. Carsten was the management.And I'm pretty sure that even in the 90s, profanities in error messages were a huge no-no, and the only reason the original developer wasn't fired on the spot is because the management didn't understand English.


  • Resident Tankie ☭

    @neighborhoodbutcher I don't know what happens in these megacorporations, I guess EFL ticked the right boxes. Basically, permissive licence (BSD or maybe MIT, right?), no licencing costs, adequate performance. Mostly, no licencing costs and duties. When it's free and your platform is squarely aimed at the bottom of the barrel (yes, POS stood in for "piece of shit") it's a match, I presume?


  • Resident Tankie ☭

    @gąska they probably didn't want to do the work themselves. Take a library and use it as is and call it a day? I mean, they could have used, I dunno, Qt, but it is/was straight GPL at the time (with commercial licencing... at a hefty price, for their goals at least), and even if it were LGPL (it is now, I think), something tells me Samsung is the kind of company that has some kind of allergy to whatever is even distantly related to the concept of copyleft.



  • @neighborhoodbutcher said in Enlightened:

    @admiral_p said in Enlightened:

    I suppose so, although Tizen targets real POS hardware and a barebones framework may have its merits...

    If by POS you mean "piece of shit", rather than "point of sale", then your sentence is right.

    No, the end of it isn't. For a POS hardware a good framework is even more important, so that there is one tested solution for each common problem rather than million broken ones. You might want to avoid managed and stick with C++, but a framework that is both efficient and hard to misuse is quite possible.

    Of course, “tested solution” and “Samsung” appear to be mutually incompatible…


  • ♿ (Parody)

    @bulb said in Enlightened:

    Of course, “tested solution” and “Samsung” appear to be mutually incompatible…

    I hear they have giant Excel documents proving they tested.



  • @boomzilla said in Enlightened:

    I hear they have giant Excel documents proving they tested.

    Which means that at least they did CYA right.

    I'm not going to defend Samsung here, but in every sufficiently large company you'll have completely idiotic processes which exist for the sole purpose of avoiding getting blamed for failures. It's 100% office politics and only about protecting your department.


  • ♿ (Parody)

    @dfdub said in Enlightened:

    Which means that at least they did CYA right.

    No, it really doesn't.

    https://what.thedailywtf.com/topic/20458/the-formal-code-review

    0_1528077251382_fd96d0ae-5fb7-4e87-b37d-cf24c6565dec-image.png



  • @boomzilla
    I don't see how that thread contradicts what I said. Looks completely nonsensical and impractical and yet like something that would impress a manager - so exactly what I described.


  • area_pol

    @admiral_p said in Enlightened:

    @gąska they probably didn't want to do the work themselves. Take a library and use it as is and call it a day? I mean, they could have used, I dunno, Qt, but it is/was straight GPL at the time (with commercial licencing... at a hefty price, for their goals at least), and even if it were LGPL (it is now, I think), something tells me Samsung is the kind of company that has some kind of allergy to whatever is even distantly related to the concept of copyleft.

    The reason they didn't want Qt was Nokia. Samsung didn't like Nokia, so by extension, they didn't like Qt.


  • Winner of the 2016 Presidential Election

    @rhywden said in Enlightened:

    @Onyx said:

    Well... fuck. There goes that OS as well.

    I know one of the devs working on Tizen. He was quite enthusiastic about it (met him last two years ago, though) - I think I'll ask him how much actual contamination influence EFL had on Tizen.

    Since I can't be arsed to be patient enough to (re-)read the whole thread first: did you ever ask him about it?



  • @dreikin said in Enlightened:

    @rhywden said in Enlightened:

    @Onyx said:

    Well... fuck. There goes that OS as well.

    I know one of the devs working on Tizen. He was quite enthusiastic about it (met him last two years ago, though) - I think I'll ask him how much actual contamination influence EFL had on Tizen.

    Since I can't be arsed to be patient enough to (re-)read the whole thread first: did you ever ask him about it?

    Yes. He confirmed that they know about this thread but he kind of had a different perspective.


  • area_pol

    @rhywden oh, does he actually like Tizen? I've never met anyone besides management, who actually did. Well, apart from one special case.



  • Just in:
    All software by Samsung is shit.

    Tldr: Samsung is Samsung, new phone is slower than old because shit software/scheduler


Log in to reply