by amitt · 9y ago · 0 comments
We built the FarmVille-engine using AS3 and I still think it's one of the best programming languages I've ever used. Static typing, access modifiers, and performant. Low friction for new users (most people had the plugin, we could stream the main binary and assets)
0% chance we could have built the game using any other client-side tech stack available at the time.
BUT, AS3 was not a great language. The VM was pretty slow (that GC! I'm sure you game devs optimized the hell out of it with object pools and all, but still, modern JS VMs could run circles around Flash's), the static typing was extremely limited: you could only type "Function", not the actual arg and return value types; type inference was non existant, Vector was invariant, etc. Let's face it, Adobe wasn't the best at language design. Typescript is today so much better than AS3 ever was.
Just needed to say that.
Now it can die happily.
His languages are the most logical and elegant I have used, all truly pleasant to work with. Building a decent language that compiles down so cleanly to Javascript is a minor miracle.
2) tsc --watch # rebuilds every .ts file on save
There is no step 3.
You can type args and returns. One of the biggest things I relied on when I coded AS3
e.g, see the signature of Array.map:
map(callback:Function, thisObject:* = null):Array
Haxe is probably something you'll be interested in:
I think a lot of the stuff that screwed the language was that it was initially supposed to be "an evolution of javascript" (ecmascript 4? I forget), so it took a on lot of the undesirable features of JavaScript, it was never a complete break from it.
Also, Adobe made a big-ish mistake in that it didn't keep the runtime separated from the VM - a lot of the VM abstractions (like pointer tagging) leaked into the runtime, and this is why a lot of things were harder to optimize in the VM than they should've been. Fortunately, the browser vendors didn't have this problem, that's why their GC could "run circles around Flash".
You still have Adobe AIR to target desktop and mobile GUI apps.
And you have a also the open source project Redtamarin
https://github.com/Corsaair/redtamarin
for shell scripts, command-line tools, server-side, etc. in 32bit/64bit for Windows, macOS and Linux
It's a shame it's going away. Glad the pros from that time feel the same way I do about it.
Of course, so is Factorio...
The worst part is that I feel productive while playing it. It's so close to the satisfaction I get from actually building something that it's just too dangerous for me to play these days :)
I was involved in developing a really simple video editor in the browser that would have been impossible (or at least incredibly difficult) to accomplish without AS3 and the graphical abilities that it allowed.
But... it really did used to suck power from laptop batteries like nothing else.
I'll miss you flash. Thanks for shaping what we do and use now.
It's really not comparable. Flash + AS was a RAD environment, many a game developer got their start (and even built full-fledged games[0]) through it. I'd argue that its biggest contributions were not web-bound[1], and I don't know of any other environment which is both as easy to get started with and as flexible.
[0] it's famously the primary expressive environment of Edmund McMillen: Gish, Aether and Binding of Isaac are all Flash though the later got rewritten natively in Rebirth, Super Meat Boy is the native successor to the Flash Meat Boy, The End is Nigh may well be his first game which did not start in Flash (and even that's unclear as it grew from a 2-weeks game jam)
[1] except insofar as they were being embedded/distributed through it e.g. newsgrounds or armorgames
Well okay. That's insane. But there's a part of me that wants to know how far it would go.
www.haxe.org
Follow haxe.io for news, etc. : https://haxe.io/
Some popular typed languages, notably Java, do type erasure on objects as well. Extending that to value types feels right in a strange way, more consistent at least.
One thing I'll mention to make The a better experience... The compiler, even on the strictest options, will still let you do a lot of hacky old school JS crap. I HIGHLY recommend integrating TSLint with almost all rules turned on and Microsoft's contrib extension. It makes Typescript code almost bulletproof.
Use the Typescript language service and experimental plugin for VSCode to show both Typescript errors and TsLint errors live with intellisense. It's a pain to set all this up at first but the experience is slick.
It supports pragmas so you can turn off assertions in production everywhere except in critical files.
I wouldn't say AS3 is the best programming language, but that's just my point of view. I, for one, don't have a favorite language because i think that each language has it's pros and cons and each language excels in a certain area.
Out of curiosity what is your language of choice now days?
Web Backend - Elixir/Phoenix (we used PHP for FV), Python in some cases
Web Frontend / Native Mobile Apps - React & React Native
JS has effectively caught up to what AS3 offered back then minus type safety (which TypeScript offers).
Would that have been a major loss for humanity as a whole ? Farmville improved the life of how many people ? how many hours wasted, people made miserable and money lifted from cash cows ?
I'll slightly mourne the passing of Flash.