HNHacker News
TopNewBestAskShowJobs

zwetan

322 karma · joined April 12, 2010

submissionscomments
zwetan··on Types Are Moving to the Right
The latest TIOBE index [0] put both ActionScript and TypeScript in "The Next 50 Programming Languages", from rank 51 to rank 100

also Pascal is mentioned at rank 204

based on that yes ActionScript do make the cut in term of popularity, or you can also remove TypeScript and Pascal from the article

also hypocrisy much?

in one of your other comments

  You are welcome. D did not actually made it to the list
  based on the language-popularity-selection criteria I’ve used,
  but I thought it is prominent enough to be included and
  overrode my criteria for it.

so that part "prominent enough" is completely subjective right?

[0]: https://www.tiobe.com/tiobe-index/

zwetan··on Types Are Moving to the Right
Let me correct that for you

  That is essentially the way it is done in Scala (2004), F# (2005), *ActionScript 3 (2006)*,
  Go (2009), Rust (2010), Kotlin (2011), TypeScript (2012), and Swift (2014) programming languages.
zwetan··on Red Flags in Software Developer Job Descriptions
let's add the obvious one

a long list of tech, skills, requirements, "must have", etc. with a low salary

zwetan··on Why Is It So Hard to Detect Keyup Events on Linux?
Very interesting, in a different context I had to tackle a pretty similar problem with Redtamarin [0]

Traditionally under the CLI you will manage key input wih a readline() command or something similar to kbhit() and depending on your needs you'll use getchar() then track if either a CR or LF is entered for the "end of command", also EOF.

This is blocking, so nothing else can happen, and depending on how you do it, you can only read single byte chars and not mutlibyte chars (like CJK input)

something like

    while( run )
    {
        i=kbhit();

        if( i != 0 )
        {
            key = String.fromCharCode( getchar() );

            if( (key == "\n") || (key == "\r") )
            {
                run = false;
            }
            else
            {
                buffer += key;
            }

            i = 0;
        }
    }
another way to do it

    while( run )
    {
        b = fgetc( stdin );

        if( b == EOF )
        {
            if( kbuffer.length == 0 )
            {
                return null;
            }

            run = false;
        }
        else if( b == LF )
        {
            run = false;
        }
        else
        {
            kbuffer.writeByte( b );
        }
    }
which has 2 greats advantages, being able to read multiple bytes input (thanks to fgetc() which read the raw byte) and detect EOF (CTRL+D under POSIX, CTRL+Z under WIN32), but still blocking forever, using fgetc() the detection of EOF is done automatically for you (while getchar() getc() etc. do not detect that EOF)

now because Redtamarin is based on AVM2 and AS3, there is one part of the API which try to reimplement the Flash API with such things like KeyboardEvent that should be able to be non-blocking but still for a CLI environment

That KeyboardEvent should detect keyUp or keyDown but yeah it is hard to detect and if you try to do that for multipel platforms liek Windows / macOS / Linux it gets nigthmarish

In a little experiment [1] I found out you can do "stupid things" that actually work, like spawning a child worker (AVM2 uses pthread), blocking on the user input (like above) and then send back a message to your main worker and so receive a "key event", all that allow to listen for input asynchronously

But then, what about making the difference between keyUp and keyDown ? I decided to ignore the keyUp because in fact it does not really matters on the CLI or I least I don't see any use to it, for a GUI yes I can see the use cases, but for a CLI? not so much

Purely on the CLI (no X Server) you don't really listen for key events you read the stdin stream, the only special events are signals like SIGINT SIGHUP etc. or special kind of signals like EOF.

The other things you can alterate is the buffering of that stdin and the raw mode/cooked mode and echo off/on.

So for a use case like navigating something using the 'w', 'a', 's', 'd' keys you just need to go async to listen for chars input (which key is pressed) and probably a mix of timeout on the last key pressed and a "diff" between the "prev key" and "last key".

If last key pressed is 'w' then go up, if you keep receiving a 'w' key you keep going up, if prev key was 'w' and the last key is different you change direction.

And to detect when to stop to go up if last key pressed was 'w' you just keep the time when this key was pressed, if 1 second elapsed and no more key events are received you stop going up, ergo you don't need to detect keyUp, but maybe I'm missing something.

  [0]: https://github.com/Corsaair/redtamarin
  [1]: https://twitter.com/redtamarin/status/900794336031510530
zwetan··on Ask HN: What are must-know concepts for back end development?
doesn't work when you can not access the machine where the cron is supposed to run for security reason or whatever

there crontab is not an anti-pattern at all

zwetan··on Best Display for Programming? (2017)
I do too

so far the best setup that works with me is 3 monitors: 1x landscape (left) and 2x portrait (right)

using something like Spectacle [0] to arrange the windows quickly

VSCode spread on the 2 portraits in a grid (2x2) layout is pretty roomy

I found out that 25" monitors work better than 27" (too high and not wide enough in portrait)

I like the Dell UtlraSharp but YMMV

[0]: https://github.com/eczarny/spectacle

zwetan··on Writing custom tools with Swift
I like it, being able to start with a shell script and then evolve the tool to a static binary is pretty neat, I do that all the time with ActionScript

I don't think it's trying to be a "jack of all trades", sure Bash can do plenty but when you reach few hundred lines of Bash and start to fight against the syntax to do simple things well...

The shebang line is there to be used, you can use sh, bash, etc. but there are other citizen like perl, php, python, etc. so why not swift or anything else if it help you build quickly command-line tools?

zwetan··on Ask HN: How to found a company as a single founder?
it is exactly the opposite imho

the idea can already be there, already implemented and even already successful

and an incredible execution can just take over

you don't take over on ideas, you do take over on implementation

few examples: hotmail and then boom gmail took over, IE6 and boom Firefox took over, etc.

in fact implementation is so much more important that you have to keep doing it right otherwise someone else take over

also you can not keep an idea secret forever, once you release your product, everyone know about it and get a shot at their own implementation of your idea

zwetan··on Ask HN: How to found a company as a single founder?
listening to an idea is entertainment

showing the idea is proof

zwetan··on Ask HN: How to found a company as a single founder?
ideas have no values, implementation does

the very same idea could be implemented in different ways, some would work, some other would fail

the only way to be sure is to build it and ship it, eg. "does my implementation provide value to customers or not?"

it does not have to be big, it does not have to be perfect, it does not have to be complete (avoid the features creep), but the implementation itself or the product is what determine the value or potential value

other people like co-founder, talents, etc. are basically people who will see the value but think "hey I can build that better", "I can sell that better", etc. and decide to join you in the process

so yeah pretty much "Start building and start selling"

for the founding part it will be either you have the skills (tech, marketing, whatever) and so invest your time, or miss some of those skills and use your own money to cover those parts

I do not believe you can rely solely on "strong ideas"

zwetan··on Google's cross-platform Flutter UI toolkit goes 1.0
No it does not work like that.

To be able to publish on iOS, there Adobe AIR compile to native binary.

On Android, Windows, and macOS (also Linux) it does not to do that (eg. it is fast enough), so instead you have the choice to publish an app that need the AIR runtime, OR to publish a captive runtime (it bundle inside the app).

In general, most dev use captive runtime and so you don't need the AIR runtime installed first.

Now, keeping a runtime bundled vs compiling to native have numerous advantages, for ex you can make part of your app dynamically updatable without re-installing the whole app.

Technically Adobe have the tech in the AIR SDK to compile to any native target, they just use it for iOS.

zwetan··on The Joy of Haxe
you're comparing apples and oranges

Flash (a browser plugin) being dead does not make ActionScript (a programming language) dead

you can use ActionScript to publish with Adobe AIR and Haxe AFAIK can do that too

zwetan··on The Joy of Haxe
Dart is not designed only to program web apps

you can target mobile with Flutter, and also command-line etc.

zwetan··on Extended Validation Certificates Are Dead
next: code signing certificates under Windows

a lot of B.S. there too

zwetan··on Adobe Flash’s Gaming Legacy and My Efforts To Save It
Let this be a warning to young developers tying into browser platforms.

For all the openness of web standards, let's remember that browsers are proprietary.

If a browser vendor decide to do something (whatever it is, good or bad), there is pretty much nothing users or developers can do, we saw it with IE6 for a long time, we now see it with Google Chrome too.

AFAIK browser plugins were considered part of those web standards (see [0] and [1])

[0]: https://html.spec.whatwg.org/multipage/infrastructure.html#p...

[1]: https://html.spec.whatwg.org/multipage/system-state.html#plu...

zwetan··on Windows gifski.exe with a digital signature
> Install and configure weirdo bespoke software for the smart card. It opens an SSH-server-hanging popup asking for a PIN, so I can't have headless automatic builds.

You can automate this with scsigntool.exe check out https://www.mgtek.com/smartcard

but yeah doing all this to publish signed exe under Windows is a PITA

zwetan··on Electron 2.0.0 beta
support has stopped true but it does not prevent to publish on Linux desktop targeting AIR 2.6

ironically you can also embed Flash into an Electron app to use the latest v28 runtime

other workaround exists with the latest NPAPI that you can embed in a C++ app (like good old WxWidgets)

zwetan··on Electron 2.0.0 beta
first, you can also get HTML ads that uses 100% CPU any technology can be abused with ads

second, Adobe AIR using 100% CPU is completely false

zwetan··on Electron 2.0.0 beta
"New features and bug fixes take ages."

ORLY?

It has been many years that Adobe AIR is updated on a quarterly basis, every March, June, September and December

https://www.adobe.com/devnet/articles/flashplayer-air-featur...

zwetan··on Electron 2.0.0 beta
You just described Adobe AIR eg. "something that has consistent, cross platform (desktop and mobile [...]), responsive ui, without the huge web stack"
zwetan··on LinkedIn won't show you your own connections without paying?
like any other social network: you are the product
zwetan··on Apple’s iMac Pro is a love letter to developers
Here my answer: I'm cheating on you and still have no regrets.

ps: my last year hackintosh build with 64GB RAM for < 5K is not impressed by those 128GB RAM

zwetan··on HSBC is killing my business, piece by piece 
> The only way to solve in the short term is to spread the risk across many banks, and never keep your money in one place.

not only banks, you also have paypal, prepaid cards, etc.

and not only "short term"

eg. always avoid the "single point of failure"

the real infuriating part here is that those problems occur on a business account (not a personal account), if you pay extra for business you should get extra/faster service/resolution.

zwetan··on Juicero Is Shutting Down
Your view on sugar is wrong and quite dangerous.

First, human beings need sugar to survive, yep it's like water, without sugar you die, in particular your muscle and your brain.

There are good and bad sugar, artificial sugar in food and drink sure are terrible for the health, but you also have natural sugar like fructose in fruits, lactose in milk, etc. those are good.

You definitively can not say that apple juice is poisonous like sugary soda.

Those are not the same type of sugar.

zwetan··on Petition to open source Flash
what about petitioning Google so they open source Swiffy ?

To me Google Chrome is the one responsible for killing Flash, Adobe is just playing catch up.

zwetan··on “We will stop updating and distributing the Flash Player at the end of 2020”
You have Flash on iOS with Adobe AIR which take your AS3/SWF and cross-compile them to a native iOS binary (ipa).
zwetan··on “We will stop updating and distributing the Flash Player at the end of 2020”
Don't forget E4X, it's here in AS3 as a first class citizen, while every single browser vendors either did not bother to implement it (google) or deprecated it after some times (mozilla).

It was quite nice to use client-side in Flash and AIR for such things as SOAP etc. but it is also quite powerful when used server-side for web scrapping and HTML templating.

I see that every day with Redtamarin

https://github.com/Corsaair/redtamarin

it does only AS3 on the command-line, there is no GUI rendering of any kind, and yet the programming language that is AS3 shine.

zwetan··on “We will stop updating and distributing the Flash Player at the end of 2020”
I have seen experiment who took the code base of Redtamarin (based on AVM2 sources)

https://github.com/Corsaair/redtamarin

and added native implementations to render UI with OpenGL API, QT API, etc.

Now, even if it is technically feasible it is not like providing a plugin for the browsers, so that would be mainly to target desktop GUI apps which Adobe AIR is already doing very well.

As for converting the whole Flash API to HTML5/JS, some parts could be done but many parts would be missing or would be impossible to port because the Browser API can not support some of those, TCP/UDP sockets for example (possible with chrome non-standard API but then does not work everywhere).

zwetan··on “We will stop updating and distributing the Flash Player at the end of 2020”
> "I'd love to have AS3 now as a language of useful programming."

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

zwetan··on Ask HN: What are some good tools for keeping a software project on track?
how do you make that work for a "remote team" ?
← PreviousPage 2 of 7Next →