HNHacker News
TopNewBestAskShowJobs

zwetan

322 karma · joined April 12, 2010

submissionscomments
zwetan··on Happy 10th birthday pandoc
I love pandoc, thanks for this great tool :)

to me it's the perfect tool to generate user docs and manuals for software and other cli tools, my best use case is markdown (github flavoured) to man, markdown to HTML and PDF, etc.

zwetan··on Flash and Chrome
google analytics is supported inside Flash

since 2008 gaforflash [1]

since 2014 as3-universal-analytics [2] (measurement protocol)

[1]: https://code.google.com/archive/p/gaforflash/

[2]: https://github.com/zwetan/as3-universal-analytics

zwetan··on Flash and Chrome
Flash is definitively the perfect scapegoat

whatever your problem: slow machine, battery, security, etc. it's all its fault

seriously, if everyone have already moved to HTML5, how come we are still blaming Flash for those daily petty problems ?

It's not used so let's block it but it is still responsible for the majority of problems ...

nobody notice the ambiguity of the argument ?

It's quite painful to see such arguments from Google, I thought they would be smart enough to understand that any popular technology get hacked, the problem is not really Flash, its the browser itself (and the advertising networks that are perfect to distribute dodgy payloads to tons of users).

The other sad point is the amalgam of everything, for some ppl Flash equals advertising, and that's bad so Flash is bad, and they don't want to think further than that.

The choice of the users ? The tons of SWF content (that will probably not be ported to HTML5) ? nobody care apparently

And about throwing everything in the same bag, so apparently if Flash is dead then ActionScript is dead too right ?

nope

Flash is just 1 runtime running in the browser, there are other runtimes: Adobe AIR for desktop and mobile, and also Redtamarin [1] for the command-line / server-side.

[1]: https://github.com/Corsaair/redtamarin

zwetan··on Flash and Chrome
could?

it did, see Adobe AIR, publishing to Windows / mac OS X / iOS / Android is imho cross-platform enough.

zwetan··on The Public Shaming of England’s First Umbrella User
"The British also regarded umbrellas as too French"

I guess it was a very bad thing at the time :D

zwetan··on Bringing ChakraCore to Linux and OS X
I think you are both right :)

even if I was talking about the host for tsc.js, the way the code is defined it should be able to run from wscript exe under Windows, although I never tried it.

zwetan··on Bringing ChakraCore to Linux and OS X
I experienced different results.

One of the main problem with JS engines is that they load external code on demand, even with something like JSDB (see [1] based on SpiderMonkey engine) where you can bundle all of your JS inside a zip that you then bundle/merge with the runtime, the JS files still have to be extracted from the zip and loaded "as file" from memory.

In the case of the AVM2, wether the files are AS3 or JS they are first compiled to bytecode (like Java) and that's what you bundle with the runtime, the bytecode still have to be loaded but it is "one big file", so wether your sources are many 100s of JS files it does not matter.

That matter a lot for the resource efficiency, and it influence a lot the memory footprint (~10MB for AVM2, ~50MB for a Node.js, see [2]), eg. the more files you load the more memory you gonna use.

For the dependencies conflict yep it make things easier too, not only for the versioning of libraries as you describe but also for the versioning of the runtime itself, eg. runtime v2 could be installed system wide but your self-contained exe could use an older runtime v1.

[1]: http://www.jsdb.org

[2]: https://github.com/eclipse/kura/wiki/Footprint

zwetan··on Bringing ChakraCore to Linux and OS X
Having different engine is good, even "non-obvious" ones

If you look at the sources of TypeScript you can see it supports: Node.js, Windows Script Host and ChakraHost (see [1])

I made a little experiment to support another engine: the ActionScript Virtual Machine (AVM2) which not only support ActionScript 3.0 but also JavaScript (see [2])

Personally it's not that I don't like Node.js, but I do like the idea to take the JS sources of some command-line tool and bundle them in one independent executable to then distribute it as a deb package or Mac OS X pkg etc. without having to first install node.js/npm

[1]: https://github.com/Microsoft/TypeScript/blob/master/src/comp...

[2]: https://discuss.as3lang.org/t/the-case-when-you-dont-want-no...

zwetan··on Ask HN: How do you decide for a backend language?
thank you :)

you got almost the answer here "It's not quite the same as AS3"

Haxe focus on transpilation/cross-compilation with its own language 'Haxe' and its own compiler, libraries, VM, etc.

The closest to Redtamarin would be the NekoVM http://nekovm.org

I would say it is a different approach, Redtamarin focus on AS3 the language but also on the AVM2 and by extension the reuse of the Flex SDK (for the compiler) and other tooling that already exists (like Flash Builder IDE).

And so when you compare Haxe/NekoVM to AS3/AVM2 the difference mainly shine in how you write programs and libraries.

Redtamarin approach is to provide a "C API" for low-level function and other syscall, so dev can write "as fast as if they were writing AS3 as usual", they only need to learn a new API and the subtleties of system programming.

You could find the same kind of differences with CrossBdrige https://github.com/adobe-flash/crossbridge

Both NekoVM and CrossBridge focus (in their own way) on the reuse of C/C++ libraries, e.g. if you need zlib you can reuse it, but then it forces you to compile native stuff.

Redtamarin almost opposite approach is to provide a kind of C standard library (POSIX like even) in the context of AS3/AVM2, which allow you to port or write the AS3 code to do native stuff in a cross-platform way, but you can not reuse external native libs like zlib.

See for example this getaddrinfo sample code ported from C to AS3 https://twitter.com/zwetan/status/752202410521726976

The logic for that is let's say you need popen2.popen2() from Python, you can implement it in AS3 reusing C functions like popen(), pipe(), fork(), dup2(), close(), etc.

Except for fork(), the AS3 code will work under Linux / Mac OS X.

You could say that Redtamarin is a lot of hard work to add small native C functions call, so dev can easily write AS3 programs for command-line and server-side.

Another example, you can take JS (ECMAScript, ECMA-262) code, compile it and run it with the redshell, I did it with the TypeScript compiler, I just needed to implement ChakraHost, the detail is here https://discuss.as3lang.org/t/the-case-when-you-dont-want-no...

So to come back to Haxe/NekoVM, I'm not so sure you could either implement popen2.popen2() with just the system libraries available or if you could just compile/run TSC sources with Haxe/NekoVM unless making a big rewrite of the whole thing.

Many people probably think that AS3 is dead because "flash is dead", but AS3 is also ES4 and so fully compatible with ECMA-262, being able to reuse IDE with just a little swap of playerglobal.swc with redtamarin.swc and instantly have syntax completion to write server-side program, publishing documentation with tools like asdoc, etc.

All those things are the reason why Redtamarin focus on AS3 the language, and why it is very different than Haxe and/or NekoVM.

zwetan··on Ask HN: How do you decide for a backend language?
I can propose another one: ActionScript 3 see: https://github.com/Corsaair/redtamarin

So yeah I'm the author of this project and while when I started it, it was mainly for fun "let's run AS3 on the command-line", couple of years ago I started to force myself to use it more and more server-side in the spirit of "eat your own dog food", and quite happy with it for my own side projects.

Now, as any other dev I also work with many others programming language server-side, and on a project where I'm the one to make the choice about which language to use I would say it does not matter much.

Seriously, most backend languages are more or less equivalent, except few details or "religious faith", it's not like the features of one particular language can make or break a project.

To chose one I pick the tech based on: who gonna maintain the project in the long run ?, what other dev (team) or owner (company, vendor, etc.) expect ?, what type of project or architecture is needed ? etc.

To be honest, being able to chose the language feels like a luxury, if you put "religion" aside, some people must trust you will make the right choice, even if you can chose whatever you want small comments like "we would like it to work on a LAMP stack", "we are a Microsoft shop", etc. can influence the choice.

But I do believe there is no wrong choice there.

zwetan··on Ask HN: How do you install developer tools on a fresh system?
Not as Bash script but some time ago I documented complete environment setup for Windows / Mac OS X / Linux

https://github.com/Corsaair/redtamarin/wiki/DeveloperEnviron...

The Windows part have a Batch script setup to automate the install of cygwin, apt-cyg, wpkg, etc.

It is very specific to the Redtamarin project, compiling C++, compiling Java, compiling AS3 to bytecode, etc.

there are also other doc for hardware setup, SSH to/from Windows, running "remote" build from the LAN, etc.

but the setup should work for about anything, comments to improve it welcome :)

zwetan··on How an internet mapping glitch turned a random Kansas farm into a digital hell
When an API "default" can ruin the life of people, it's really sad that such "IP intelligence" was not thought right from the beginning to answer "can not be found".

Similar story [0] to a lesser degree is still horrible to the people it affects.

[0] https://gimletmedia.com/episode/53-in-the-desert/

zwetan··on YouTube-dl: Open-source YouTube downloader
I did a similar little prototype[0] long time ago, learned couple of interesting things from it, then moved to other protos

[0] http://www.burrrn.com/

zwetan··on YouTube-dl: Open-source YouTube downloader
how enforceable is the TOS ?

once something is published on the internet then it is assumed it can be viewed / copied / downloaded / etc.

see https://en.wikipedia.org/wiki/Web_scraping , the legal issues part.

zwetan··on Tay – Microsoft A.I. chatbot
"Chill with Tay on Kik"

LOL maybe we can talk about npmgate then ?

zwetan··on I've Just Liberated My Modules
funny thing, but assuming that kik is related to kik.com

if you look here http://dev.kik.com/build/, they promote their own server eg. "Our open source web server Zerver can help serve your cache manifest properly, as well as doing other speed boosting stuff like automatic style inlining."

this Zerver is on github and build with npm

https://github.com/jairajs89/zerver/blob/master/package.json

I did not run the build but I'm pretty sure that now their server is not building anymore as it depends on babel

call that irony ;) ?

zwetan··on Ad Nauseam
OK, remember you asked for it

"If you know otherwise, then please cite the specific CVEs. Otherwise, you're just spreading false information"

man, you are so full of it

want proof ? no problemo

1. CVE are organised by vendors and products

HTML and JS does not show as products, only browsers

see http://www.cvedetails.com/top-50-products.php

look #3 Firefox, #4 Chrome, #8 IE

that explains why you will never see a specific HTML and/or JS CVE, that does not mean they don't exists.

Also in term of volume, browsers have more CVE than Flash, it's all here in the numbers: Firefox 1320, Chrome 1216, but no let's ignore them and focus on Flash 713 CVE.

Just that it make your whole argument biased, the part "JavaScript itself has been pretty stable for years" is ridiculous, search for JS blackhole exploit, Rowhammer.js exploit, Heap Overflow exploit in JS, etc. you don't see them in CVE but they are here and exploitable.

It's better to think than JS is secure looking at that http://www.cvedetails.com/vendor/10288/Javascript.html

yeah no exploit in JS, none, we are all safe LOL

this for example http://www.cvedetails.com/cve/CVE-2015-0817/ http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-0817 https://www.mozilla.org/en-US/security/advisories/mfsa2015-2...

you don't see it show up under the tag "JavaScript"

2. Number of CVE listed do no equals CVE exploited in the wild

so you say "It averages to about 1 every 3 days", that's completely false

1 vendor patch for a particular product can close numerous CVE at the same time so it's more like "we squashed 50 CVE in 1 day"

look at http://www.cvedetails.com/cve/CVE-2015-8449/

follow up on https://helpx.adobe.com/security/products/flash-player/apsb1...

that's 1 patch, it does not indicate 1 CVE every 3 days, look at the details

"These updates resolve use-after-free vulnerabilities that could lead to code execution (CVE-2015-8050, ..." that's more than 50 CVE of the same type patched and closed at the same time

Also look the "Acknowledgments", numerous security team reported all those CVE for them to be patched, there is no indications they were exploited in the wild.

Saying such things as "oh 30 CVE discovered in 1 month, so that means there were 1 CVE per day" is totally misleading, even more misleading to assume all those CVE were exploited by default (eg. "could lead to").

At best it indicates that they (Adobe and other security team) are more serious about discovering and patching those CVE and so they close more of them more often.

zwetan··on Ad Nauseam
"Or you could have ad networks that only circulate carefully vetted/curated ads."

No, you make it simpler than that

you simply forbid ads to be interactive or to contain any code

eg. you do only static ads like text, image, video

no code, no way to hide nasty stuff

zwetan··on Ad Nauseam
and again Flash is the scapegoat

"By converting unsafe flash-based ads to safe HTML5 ads, they lower the risk of infection from a hostile ad." is laughable at best

An Ad Network is one of the fastest way to deliver a payload to a lot of users

Don't fool yourself, Operating Systems, Browsers and HTML5/JS also have a hell lot of CVE that can be exploited

It's funny how a company like Google making Billions from ads, having ton of smart engineers, have never figured out during the last decade how to "scan ads for malware".

It's not like anyone can upload an ad to those big network, or that they don't QA the ads before delivering them ...

Imagine this unlikely scenario: malware delivered by HTML5/JS

I guess we'll all have to run for the hills if that happen

zwetan··on Hackathon Be Gone
and worst,

the sale pitch have more value, than the code written to build the app

zwetan··on Hackathon Be Gone
I see hackathon as a scam

or how to teach early to young new passionate developers that the "norm" is to work long hours for next to no pay, pizza? yeah good enough.

It also vehiculate the idea that code is a just commodity, that anyone can piss some code over few days and build full working apps supposed to impress people.

Well, understand those poor company, they are not sure you can be a good slave, so they need to test you over a week-end: does he/she complain for not being paid? not sleeping? being forced to use this API vs another?

howdy boy, "slap on the back", here your prize, by the way everything you have produced this week-end is owned by whoever organized the hackathon and they can do whatever they want with it while still not paying you, now go away you need to sleep and you stink.

I saw companies organizing hackathon for their own employee, not something open to other developers or involving a public API, no sir, a company week-end event.

They did those hackathon to allow their own employee to work on "what they like" or "what they did not have time to work on during working hours", but still have to be related to the company business, in exchange of beers and pizzas .. oh and if you don't show up we'll know you are a lazy bastard not inline with the company direction.

So yeah maybe not all hackathon are like that, but most of them has this feel of scam where at the end you want to scream "fuck you pay me".

zwetan··on Ask HN: How do you track what you learn?
personally I use a local wiki to keep notes, links, research etc.

https://github.com/gollum/gollum

zwetan··on Cash: a cross-platform implementation of Unix shell commands in JavaScript
I have no problems with powershell wanting to pipe "objects" but I still want a POSIX environment under Windows.

And about why POSIX deserve to win ?

For me it's about cross-platform command-line, I need to be able to run command-line tools that just behave the same under Windows, Mac OS X and Linux.

So far, Windows has ignored the command-line for years, and when they don't ignore it they change it every couple of years, from scripting hosts WSH to PowerShell to whatever else ...

Just sayin' it's hard to take Windows seriously when it come to the command-line environment, it is a huge mess.

zwetan··on Cash: a cross-platform implementation of Unix shell commands in JavaScript
doing about the same here but using only cygwin and cygrunsrv to run sshd

it work quite well, and yeah ssh to a windows box with a real shell is definitively something you want :)

zwetan··on Cash: a cross-platform implementation of Unix shell commands in JavaScript
well you are just replacing your dependency from cygwin to node.js

think of it, what is the utility to implement shell commands in a cross-platform way ?

only for Windows

You don't need an ES6 implementation of `ls` on Linux and Mac OS X, the tools are already there and yeah they are "ugly" compiled to native executable, but it is exactly what you want for shell commands

so you are basically trying to solve a Windows problem, but sorry you're doing it wrong

Windows problem is not about lacking shell commands, it's about lacking a POSIX environment

sure you want command line utilities like `ls`, but those are mainly useful when run inside a POSIX environment, and that is exactly the problem that cygwin have solved.

Now about some statements

"No ugly DLLs":

try to do a `ldd /bin/ls` on a Linux system you will see dependencies on `libc.so`, `libselinux.so`, etc. having tool like `ls` being dependent on `cygwin.dll` etc. is perfectly normal, nothing ugly about it

"Works in any terminal":

all the cygwin binaries can work inside a `CMD.exe` prompt, just add the "C:\cygwin\bin" path to your environment variables.

when you run Bash shell like Mintty, you also have access to the `CMD.exe` environment on top of the POSIX environment, for ex: you can call powershell scripts.

"Let's mix some Windows & Unix commands together"

`$ ipconfig | grep IPv4 | sort` works perfectly fine under Cygwin with bash

"but I only want certain commands"

maybe use package management, for ex you could use apt-cyg with cygwin, and do things like `$ apt-cyg install ncurses` or `$ apt-cyg remove ncurses`

zwetan··on Show HN: Bonsai (YC W16) – bulletproof contracts and payments for freelancers
look nice

couple of questions

  - do you plan to make it work with something like Paypal API ?

  - maybe other language than English ?
look promising anyway
zwetan··on Break Up the Insulin Racket
no problem, it's like the honey moon period for a type 1 patient

I was saying "maybe", in general I see type 2 ppl who are just on pills and have no need to take insulin, but yeah the diabetes can progress in different way, no problem with that

zwetan··on Break Up the Insulin Racket
did you read the article about the patent and how insulin been discovered ?

here some quotes

"Insulin's Canadian discoverers sold the patent to their university for $1, stating that profit was not their goal."

"Discoverers Didn't Intend Insulin to Become a Profitable Monopoly"

so yeah I blame big pharma

they took over a cheap patent, made some modification and abused the patent system on a non-curable illness that affect more and more people

and when the profit is not enough, they raise the price

what's your arguments again ?

that they are entitled to makea profit ?

when they did not discovered or produced the original patent ?

are you saying that seriously ?

zwetan··on Break Up the Insulin Racket
so misinformed ...

what about a 5yo kid who just got diagnosed with diabetes type 1 ?

also did you know that when you take insulin, it is the insulin that have the tendency to make you overweight ?

Correlation does not imply causation, go educate yourself about diabetes.

zwetan··on Break Up the Insulin Racket
in France, in UK, and probably rest of Europe people with Type 1 and 2 diabetes are taken in charge 100%

that means whatever amount of insulin you need, you get it for free

and it's not only the insulin, it's also all the rest: test strips, glycemic reader, etc.

I'm pretty sure the article is wrong about

"had Type 2 diabetes for over 30 years. She takes several injections of insulin each day."

this more describe Type 1 situation

anyway, I'm pretty sure the price of insulin went up also in Europe, except the government paid the bill, not the patient, a bit more civilised but still the problem stay the same:

big pharma corporation are abusing the situation and make money from it, it is disgusting and criminal

first, about the patent and why there is no generic insulin, read http://www.medscape.com/viewarticle/841669

second, most people are uneducated about diabetes, they think it concern only fat people or other countries, and other BS like that

nope, it is worldwide major public health problem, many studies show the amount of people with diabetes rising , for ex

http://www.nytimes.com/2015/06/08/health/research/global-dia...

"reported a 45 percent rise in the prevalence of diabetes worldwide from 1990 to 2013"

finally, why it is disgusting and criminal for pharma corp to make ppl pay for insulin ?

it as simple as that: if you don't take insulin you die, period.

It's not curable, there is no alternative diet, nothing, zilch, nada

and those big pharma corporation they made a business to profit from that, and when profit is not high enough, simple, raise the price.

← PreviousPage 4 of 7Next →