Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Progressive JPEG
Feb 19, 2003

feedmegin posted:

Mate one of the products I worked on shipped its own copy of the Python interpreter as part of its runtime, even

isn't that the purpose of virtualenv?

Adbot
ADBOT LOVES YOU

Nomnom Cookie
Aug 30, 2009



feedmegin posted:

What if you're opening files on, for example, a commercial Unix with a legacy encoding like EUCJP for Japanese? 'If it's not Unicode it's garbage' is not a practical approach in the real world.

shoulda said GB2312, which is only supported for decoding.* https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html is the list of supported character sets

* i have fixed actual customer affecting bugs caused by this one

Notorious b.s.d.
Jan 25, 2003

by Reene

Progressive JPEG posted:

isn't that the purpose of virtualenv?

oh, ye of little years

feedmegin
Jul 30, 2008

Progressive JPEG posted:

isn't that the purpose of virtualenv?

What are the chances of the customer having that installed on their AIX 5 box?

feedmegin
Jul 30, 2008

ulmont posted:

Sure, but outputting to a well-known encoding scheme isn't that big a deal, and in the java example would be easily handled by just setting the default character encoding for the environment to EUCJP (if it wasn't already).

Right. Now the user copies a file from a newer system with a name which is in UTF-8. What now?

On a UNIX system a filename is a sequence of arbitrary bytes. Trying to coerce it to human text is always going to lead to tears in the edge cases.

Cybernetic Vermin
Apr 18, 2005

and obviously it is unix that is in the wrong here, but that doesn't really solve any problem.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I was the guy complaining about Python 3's handling of the separate types -- I still think it's kind of unpythonic, since if I'm handed a file object I don't know whether it's in bytes or not. If you read from it you're lucky since you can do .read(0) and then check whether it's b'' or '', but with a .write() you have to try and catch the exception. So the "file" object has an API that changes invisibly and can't be tested for without trying. This sort of half-baked approach to upgrading the standard library worn me down to the point that I gave up on Python altogether.

In later Python 3 releases they put back a lot of the functionality that they intentionally removed from the bytes type, but that shows that their initial hard line stance about what bytes and str were wasn't as useful as first thought.

Not to mention the whole "code points being your fundamental Unicode element" thing is short-sighted in the same way UCS-2 was short-sighted, though it was the popular choice at the time. Newer languages like Swift use extended grapheme clusters which is a better choice.

ulmont
Sep 15, 2010

IF I EVER MISS VOTING IN AN ELECTION (EVEN AMERICAN IDOL) ,OR HAVE UNPAID PARKING TICKETS, PLEASE TAKE AWAY MY FRANCHISE

feedmegin posted:

Right. Now the user copies a file from a newer system with a name which is in UTF-8. What now?

Copies a file from the newer system to that commercial UNIX using EUCJP? I'm probably missing your point now, but if that has to be done in the hypothetical Java program then yes, then you'll need to know so you can switch your locale on the fly as applicable.

feedmegin posted:

On a UNIX system a filename is a sequence of arbitrary bytes. Trying to coerce it to human text is always going to lead to tears in the edge cases.

Well, yes. Particularly in the case of "I want to use bytes that do not represent a legal Unicode character sequence using any known encoding scheme."
But the simpler case of "I need to open a file on a system that doesn't use UTF-8 for filenames" is pretty easy.

aardvaard
Mar 4, 2013

you belong in the bog of eternal stench

Internet Janitor posted:

fabrice bellard's new dependency-free embeddable js interpreter kinda owns

wonder how long it'll be before somebody uses it to build a javascript bootloader and begin the js apocalypse, as the legends foretold

-7 years

https://github.com/charliesome/jsos

Progressive JPEG
Feb 19, 2003

feedmegin posted:

What are the chances of the customer having that installed on their AIX 5 box?

I just mean it seems to be SOP for python distribution to involve throwing up your hands and saying "gently caress it just include a copy of the whole runtime/stdlib"

Cybernetic Vermin
Apr 18, 2005

Progressive JPEG posted:

I just mean it seems to be SOP for python distribution to involve throwing up your hands and saying "gently caress it just include a copy of the whole runtime/stdlib"

because that is the only sensible choice if you intend to at all offer support.

FlapYoJacks
Feb 12, 2009
I'm writing I2C drivers in PYTHON. :v:

BobHoward
Feb 13, 2012

The only thing white people deserve is a bullet to their empty skull

ratbert90 posted:

I'm writing I2C drivers in PYTHON. :v:

pro redtext / post combo

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

Someone's got to do it.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Cybernetic Vermin posted:

because that is the only sensible choice if you intend to at all offer support.

lmao if you dont have a wiki they can look at instead of actual support

qsvui
Aug 23, 2003
some crazy thing

taqueso posted:

Someone's got to do it.

they actually don't

Progressive JPEG
Feb 19, 2003

Cybernetic Vermin posted:

because that is the only sensible choice if you intend to at all offer support.

yeah i guess if youre already trying to distribute python code to end users may as well go whole hog crazy with it

Nomnom Cookie
Aug 30, 2009



feedmegin posted:

Right. Now the user copies a file from a newer system with a name which is in UTF-8. What now?

On a UNIX system a filename is a sequence of arbitrary bytes. Trying to coerce it to human text is always going to lead to tears in the edge cases.

java uses the platform encoding (on unix, easiest way to set is $LANG) for encoding filenames to open(2)

do you really, really want to propose that using byte[] for filenames is a superior option when programmers are typically fuzzy on how characters sets work and gently caress it up constantly, using the platform encoding is correct 99.9999% of the time anyway, and the other 0.0001% is supporting complex, difficult functionality on fubar systems. (like, how does your UTF-8 filename get passed to the JVM when LANG=EUCJP?) when you could, you know, push back on the customer a tiny bit and tell them to set LANG and use it properly

Nomnom Cookie
Aug 30, 2009



oh and it's not like itd be hard to use some reflection fuckery or jni fuckery to open files using byte[] if you really wanted to. it's just the kind of insanity that imo has no place in a stdlib

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

feedmegin posted:

On a UNIX system a filename is a sequence of arbitrary bytes. Trying to coerce it to human text is always going to lead to tears in the edge cases.

on some filesystems a filename is a sequence of arbitrary bytes

other than path decomposition, UNIX will eventually pass whatever you’ve given it through to the underlying filesystem

Vomik
Jul 29, 2003

This post is dedicated to the brave Mujahideen fighters of Afghanistan

Krankenstyle posted:

lmao if you dont have a wiki they can look at instead of actual support

I’ll make the wiki

Workaday Wizard
Oct 23, 2009

by Pragmatica
does rust’s OsStr satisfy these wacko filenames?

VikingofRock
Aug 24, 2008




Shinku ABOOKEN posted:

does rust’s OsStr satisfy these wacko filenames?

It should, since that's OsStr's entire raison d'être.

tef
May 30, 2004

-> some l-system crap ->

Progressive JPEG posted:

I just mean it seems to be SOP for python distribution to involve throwing up your hands and saying "gently caress it just include a copy of the whole runtime/stdlib"

we have always been at war with dynamic linking

animist
Aug 28, 2018
"microservices" are just dynamic linking over HTTP

Bloody
Mar 3, 2013

animist posted:

"microservices" are just dynamic linking over HTTP

holy poo poo

Soricidus
Oct 21, 2010
freedom-hating statist shill
i heard that static linking is more efficient so now i always hardcode the ip addresses

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

animist posted:

"microservices" are just dynamic linking over HTTP

we consider our "service" a remote shared object, you have to match the hash of the protocol to connect to it lol

Beamed
Nov 26, 2010

Then you have a responsibility that no man has ever faced. You have your fear which could become reality, and you have Godzilla, which is reality.


animist posted:

"microservices" are just dynamic linking over HTTP

loving hell

Kazinsal
Dec 13, 2011

Sweeper posted:

we consider our "service" a remote shared object, you have to match the hash of the protocol to connect to it lol

this website is covered by the GNU General Public License. by connecting to it any and all of your knowledge improved as a result is inherently covered by the GPL.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

animist posted:

"microservices" are just dynamic linking over HTTP

Aaronicon
Oct 2, 2010

A BLOO BLOO ANYONE I DISAGREE WITH IS A "BAD PERSON" WHO DESERVES TO DIE PLEEEASE DONT FALL ALL OVER YOURSELF WHITEWASHING THEM A BLOO BLOO

animist posted:

"microservices" are just dynamic linking over HTTP

im screaming

redleader
Aug 18, 2005

Engage according to operational parameters

animist posted:

"microservices" are just dynamic linking over HTTP

:catdrugs:

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Kazinsal posted:

this website is covered by the GNU General Public License. by connecting to it any and all of your knowledge improved as a result is inherently covered by the GPL.

GPLv4 preview looks p bad OP

Workaday Wizard
Oct 23, 2009

by Pragmatica

animist posted:

"microservices" are just dynamic linking over HTTP

:weed:

FlapYoJacks
Feb 12, 2009

animist posted:

"microservices" are just dynamic linking over HTTP

New title please.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



ratbert90 posted:

New title please.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

ratbert90 posted:

New title please.

cinci zoo sniper
Mar 15, 2013




ratbert90 posted:

New title please.

Adbot
ADBOT LOVES YOU

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

animist posted:

"microservices" are just dynamic linking over HTTP

yeeeoogh

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply