[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Where were you when Python was kill? https://opensource.goo

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 49
Thread images: 3

Where were you when Python was kill?

https://opensource.googleblog.com/2017/01/grumpy-go-running-python.html

Google has created something that turns Python scripts into Go programs. Although programs compiled this way run much faster than CPython, don't have to worry about the GIL, and can call into Go code natively, it's missing support for Python 3, a couple of Python 2 features, and anything using the C API. It's pretty clear at this point that Google is using this tool to migrate all of their old legacy Python code.

Seems like the Python meme is finally dead, lads.
>>
>trading one retarded shit language for another
>>
>>58325668
what language should i learn instead?

im a total beginner
>>
>>58325708

I think it depends on what you want to do.

Unfortunately, I don't think that there is a better language for beginners than Python. The language has a ton of warts and misfeatures, and the Python 2 to 3 transition has basically killed the language outside of academia, but if you asked me to name a better language for beginners I couldn't think of one.

If you're like half of the people on /g/ though and you eventually want to make games, I would recommend LÖVE, as the Lua language that it embeds is an extremely quick study and you don't have to deal with Python's nightmarish dependency system or with the bloat and associated rigmarole of something like Unity.
>>
>>58325703
extremely underrated post
>>
>tfw still programming in Perl at work
It's actually decent, but I don't know if it's Stockholm syndrome at this point or Perl actually being good.
>>
>>58326002
wow thanks anon for the thorough response

if i learned Lua would i eventually be able to hack in warcraft?
>>
>>58326038

Not really. Go has real shortcomings, and I wouldn't recommend it for beginners, but it's a damn sight better than pretty much all the alternatives in the niches it is currently filling.
>>
>>58326126
>diarrhea is the best type of shit
jewggle shill pls go and stay go
>>
>>58326002
9/10 post because:
>Pythons nightmarish dependency system
Care to explain this? Din't you mean the nightmare that is pip?
My OS' package manager never let me down. For badly documented github libraries take like 2 minutes to figure out the dependencies from the imports

>>58325668
Don't really think its 'kill', they still use python a lot for prototyping and research since it's so convenient to write. It's not weird that at some point you transpile to something more efficient for production performance.
If that meant 'kill' then all interpreted languages would be just as kill as python.
>>
>>58326078

The downside of Lua, and why I don't recommend it as a general purpose language, is that the language was designed to be embedded in other programs, and that's where you often see it. If you want to create a program "from scratch", Lua is a horrible choice for a language. However, if you want to go from 0 to Mario Brothers ripoff in a short amount of time, LÖVE and thus Lua is the path of least resistance. And that's nothing to be ashamed of, games are a fun first programming challenge.

> if i learned Lua would i eventually be able to hack in warcraft?

Not really. The extent to which Lua is used in World of Warcraft is for client-side interface functionality. So unless you're really into creating interfaces, I wouldn't bother.
>>
>>58326172
Diarrhea is the best type of shit though. You don't have to strain yourself pushing it out and it's easy to clean up because it doesn't get caked on.
>>
>>58326321
I don't know, I'd rather push shit out rather than burn my asshole with the acid that comes out from diarrhoea
>>
>>58325668
But MCP still use .py scripts for non-windows users you fucking idiot.
>>
>>58325708
C++ obviously
>>
>>58326271

If somebody wants to make games, an already-working all-in-one solution like LÖVE is perfect.

As to why Python dependencies suck, for all the deserved shit that Node.js gets, it got dependencies 100% right. npm installs to the current directory's node_modules folder, and require automatically picks up on them.

You don't need to use virtual environments or know the correct command line invocations to work around the fact that pip and friends have pants-on-head stupid defaults that tries to install packages to the SYSTEM PACKAGE FOLDER by default (seriously what the fuck).

On windows it's less of a hassle because big well known python libraries have dedicated installers, but the only widely-used gaming library that has installers that I was able to find was PyGame, and that library is pretty dogshit last I used it and it's STILL STUCK ON SDL 1.x (seriously what the fuck).

For people who know the ropes, it's no problem, but if somebody just wants to see sprites in a window I'm not going to recommend them that rigmarole.
>>
>>58326277
ive only ever used game maker studio(gml) and dabbled in python on my raspberry pi.

I guess i have a lot to learn before i could ever make a game or do any real coding.

Do you have any recommendations on where i start learning?

im currently out of project ideas :*(
>>
>>58325668
>YouTube’s front-end runs on CPython 2.7, so we’ve put a ton of work into improving the runtime and adapting our application to work optimally within it.

The 2 to 3 change has killed python
>>
Why didn't they just make a Python to C transpiler? Go is a meme language.
>>
>>58325668
Is it worth learning python/flask or should I just go off to my trendy javascript safe space and leave this language behind?
>>
>>58326675

One of Google's major needs was concurrency, and the developers wanted to piggyback off of Go's existing M:N green threads implementation instead of using plain old OS threads or rolling their own concurrency solution.
>>
>>58326887
What fucked up operating system are they using that doesn't support threads?
>>
>>58327240

Go's M:N green threads actually map to a configurable number of underlying OS threads. They are much more lightweight than OS threads, and you can have (many) more of them.
>>
What are some widely used programs written in Go?
>>
>>58327355
Docker and Hugo.

That's it.
>>
>>58325668
if err != nil
>>
>>58326797

If you're going to learn a traditional CGI-style "build the world, do your thing, destroy the world" language, you might as well learn PHP.

I'm not being glib. Wordpress is still the 9,000 lb gorilla of CMSes. Thus, if you know you know enough PHP to hack on Wordpress, you will never be out of work. The language has also come an incredibly long way, gradually getting rid of old broken shit like magic quotes, introducing real package managers like composer, and getting a considerable speed-up with PHP 7.x.

And honestly, the traditional CGI paradigm is actually not bad for 99% of sites. The usual Node paradigm has you essentially programming your own long-running event-driven HTTP daemon, which leads to stupid shit like dogmatic "ASYNC ALL THE THINGS" stupidity and CPU-bound tasks blocking the entire server.

Don't actually use Wordpress for learning or personal stuff though. Use a decent framework like Symfony or Laravel, or if you actually want something approaching the complexity of Flask try Slim or Silex.
>>
>>58325708
Python is the most general language. For example the TensorFlow library is written in C++ but uses python wrappers so any academics sitting in a data science lab can use it easily. That's the deal with this Python->Go script it's so whoever can sit around with Python and produce Go binaries to run on any system without needling a pile of framework/interpreters on that system.

So you should probably learn Python as they'll just Python everything, kind of like how Scheme/Lisp was used as an abstraction for everything (Guile-C.. turn scheme into C code, lambdanative turn scheme into mobile apps ect).

here you go: https://www.cs.cmu.edu/~112/schedule.html each lecture has a video with it
>>
>>58326321
>it's easy to clean up
I seriously fucking hope you're trolling.
>>
File: 1473985955915.png (371KB, 832x868px) Image search: [Google]
1473985955915.png
371KB, 832x868px
>>58327586
>tfw you hover the reply expecting a response regarding garbage collection and you get this
>>
>>58327532

>So you should probably learn Python as they'll just Python everything,

Python will never be a decent least-common denominator language because literally everything in the language can be fiddled around with and monkeypatched using setattr. This is a huge misfeature of Python, it's like reflection on steroids and makes most natural routes of optimization a complete non-starter.

If you read the Unladen Swallow post-mortem, you'd see that Google's efforts at speeding up Python were impossible without breaking backwards-compatibility. Grumpy does in fact break backwards compatibility, but such a break actually makes sense in the context of migrating off the language, since you're going to have to rewrite stuff anyway, might as well bring the old functionality along and gradually wean yourself off it until you're left with 100% Go.
>>
>>58327532
>https://www.cs.cmu.edu/~112/schedule.html

I'm not the guy that you replied to but thanks for this link bro, its really useful!
>>
>>58326646
Python 3 will take over one day. Remember, we're dropping support for Python 2 in 2020!
-- Python Core Team
>>
>>58328170
They're not trying to switch 100% to Go. They're switching from Python + C to Python + Go. Go is used when performance is more important than clarity.
>>
>>58326887
>>58327240
>>58327331
Can somebody please explain to me what M:N threads are and how they are different from an OS thread?
>>
>>58328361

I actually got the N and M backwards, it's actually called N:M green threads.

OS threads are OS features and scheduled and managed by the operating system kernel. Green threads are features of the language or green thread library you happen to be using, and are scheduled and managed by the language's runtime library, virtual machine, or the green thread library.

The nice thing about green threads is that they usually have much less overhead than OS threads. The problem with plain old green threads is that they don't actually give you parallelism because naive green thread implementations simply run in one OS process/thread. Green threads often have other problems too - they presuppose the use of a runtime to actually schedule and manage them, and if you try and add green threads to an existng language, code will have to be rewritten (and libraries have to either be rewritten or wrapped somehow).

What N:M green threads do is that it spawns a certain number number of OS threads (In Go's case, one per core) and one or more green threads to each OS thread. In effect, it gives you true parallelism from green threads. Go also had green threads (what you know as goroutines) from the very first public version as a headliner feature, and there is indeed a runtime included in every compiled binary that schedules and manages them.
>>
>>58325668
>Killing Python
>By making it fast as fuck

Wew lad
>>
>>58328348
Clearly you've never read a Go program.
>>
>>58325668
>killing the meme that is Python
All Hail Google!

>>58328348
>Go is used when performance is more important than clarity
Clarity is one of Go's strongest points though.
>>
>>58328942
Indeed hence Gofmt tool that automatically formats Go source code so everything is uniform and you can do things like export any language to go easier.

My only problem with Go is Go doesn't protect you against race conditions (concurrency), it merely offers some concurrency tools. There is nothing to declare ownership of objects in memory. So the compiler doesn't (can't) complain if you share memory and access it simultaneously. At best, there are runtime checks. Race conditions tend to break on the worst possible ways. It either silently corrupts data, or makes your system stop working but stay active, so the OS does not know it must launch a new instance and these bugs persist for years even with the best developers trying to track them down.

Erlang is a bit better at this, so is Rust with type-level enforcement. Erlang's concurrency is "don't communicate by sharing, share by communicating" enforced at the language level: an Erlang system is composed of processes which each have their own heap (and stack) and an incoming "mailbox", an Erlang process can only interact with the world by calling BIFs (built-in "native" functions, Erlang syscalls) or sending messages to other processes, and messages can only contain immutable data structures (mutation happens only at the process level).

tl;dr if you're doing something that requires concurrency and it will scale to millions of users don't use Go, use Erlang or Rust when it's stable.
>>
>>58329302

If you are writing something where the scalability and fault-tolernace of Erlang shines, at some point you will probably need to add a second developer to your team. Good luck with that. Erlang is pretty good in its niche, but as a general purpose programming language it is beyond dogshit, and most people learn languages that can do more than one niche thing well.

I suppose you're sorta right about Rust, but let's be clear about what Rust's safety actually buys you. The only kinds of problems Rust prevents are the same kinds of memory safety problems that would get caught at runtime by Go's race detector. There is nothing preventing you from deadlocking a Rust program.

I do think that Rust has a bright future though, if for no other reason than because anybody who has ever written C or C++ can immediately appreciate what Rust is trying to do - safety enforced by the compiler without the overhead of a runtime or a virtual machine - and is probably willing to look past the onerous requirements the compiler puts on their code. However, I'm not sure that by itself is enough to win itself enough fans to be mainstream.
>>
File: 3BX.gif (24KB, 320x320px) Image search: [Google]
3BX.gif
24KB, 320x320px
>>58325668
This is great news!
Python 2.7 is now top choice.
>>
>>58325668
OP, it's basically >>58325703

For missing Python 3 support and C extensions (literally the only good thing about Python) to compile to a Go program...
You have to like dicks a lot to find this attractive.
>>
>>58334640
found the inarticulate C++ dev

I bet you hold your pencil in a fist too.
>>
>>58325703
>10 years from now.
>Google finishes migrating scripts from meme language 7 to meme langauge 8.
>Scripts have been translated so many times they are largely incomprehensible.
>Small bug fixes and feature creep are the only alterations that occur in each meme iteration.
>Nobody at google or anywhere else is capable of understanding or migrating the changes in meme language N to meme languge N-1.
>Translations have to be from meme language N to meme language N+1
>Efficiency losses have been taken up by advances in silicone.
>The bloat is still showing.
>New meme languages don't even pretend to be efficient anymore.
>Adoption of new language is ostensibly based on buzzwords, sjw perceived inclusiveness and the cuteness of the mascot.
>Data on these metrics is gathered from "code artisan" blogs by a script nobody understands anymore.
>>
>>58325668
I just started learning python.

I don't really care though considering I'm doing it as a hobby and it seems like a good place to start

Also holy fuck code academy is awful at teaching syntax. They never explain the logic behind it and just hope you notice the pattern.

Any other places with easy retard-proof explinations? The off-the-rails parts are killing me.
>>
>>58335776
TFW this is how the singularity will happen
>>
>>58329302
or you know... don't share state?
>>
>>58331159
>I do think that Rust has a bright future though, if for no other reason than because anybody who has ever written C or C++ can immediately appreciate what Rust is trying to do - safety enforced by the compiler without the overhead of a runtime or a virtual machine - and is probably willing to look past the onerous requirements the compiler puts on their code.
I don't know what you're talking about. Rust doesn't bring anything to the table that isn't already covered by the tooling any C/C++ developer is REQUIRED to know and use.
Thread posts: 49
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.