Better HN
topnewbestaskshowjobs
Log inSign up

TheZenPsycho

1,505 karma · joined Nov 20, 2012 (14y ago) · 654 submissions

I know a lot about JavaScript. Some might say, TOO much. I used to have another account ZenPsycho which I lost access to. I've made some interesting things for various large public cultural organisations in Australia. I enjoy pixels.
Submissions

comment 11y ago · link · parent

OSX fundamentally doesn't support robust tiling window managers. they exist only as a pale shadow of the real thing.

comment 11y ago · link · parent

My current obsession is finding a way to filter an image to display using the sharp MZ-series character set: http://www.sharpmz.org/mz-700/codetable.htm Very interesting symbol table for its time. Japanese so, it's like they always wanted emoji.

comment 12y ago · link · parent

Yes, wanting some other language in the browser is a very common wish on hacker news. It's just completely and utterly impractical in real life.

Even if you found some way to get some other language into the browser without translating to javascript; (and this has been done before. remember vbscript?)... the new guest language has to co-exist with any javascript that might also run on the page, share the same memory, share the same dom objects, share the same GC, and avoid all the multiple potential nasty browser crashing bugs that could result from trying to do that. And you have to ship the runtime for that language along with the browser, or as sigh another plugin. And guess what, no backwards compatibility.

Given that, you then have to cope with the fact that javascript's GC might not totally make sense for your language, and do all the workarounds that requires.

Compiling to ASM.js gets around this by essentially giving you a low level VM whose bytecode just happens to look like javascript, and whose behavior when interpreted as javascript happens to be correct. When run in firefox, the code is short circuited and ahead-of-time compiled. It doesn't have to deal with the javascript GC since it allocates a heap for the guest program ahead of time as well.

This is really cool if you think about it. You get javascript's more or less secure sandboxing, you get access to all the apis, you can interact just fine with existing javascript libraries, with about the lowest amount of overhead you can get just short of the NaCl approach (which is basically just a revisit of activeX)

The only downside to all this:

it's not the web.

This is not web. It runs in a web browser, but it's downloading a blob up front, ahead of time compiling, and playing a raw executable inside a browser host.

There's considerable advantages to zero-install programs and games. But you know, exchanging one kind of opaque inaccessible blob in a webpage for a different kind that just happens to not need plugins is not that great.

Accessibility is a good thing, and we shouldn't be too eager to throw it away for the shiny.

comment 12y ago · link · parent

>How's that offline web apps thing going?

it was going just fine until apple disabled it in iOS7

but despite that setback, google continues to bank its entire business on offline web apps.

comment 12y ago · link · parent

Yep. just compile it to javascript/asm.js and you get basically native speed, same security sandbox as javascript, and all the same problems with the web; the vast majority of which have absolutely nothing to do with javascript.

comment 12y ago · link · parent

the performance and memory bottleneck in the web is not, as it is commonly believed, javascript, or html.

It's the increasingly complicated DOM, and CSS3 layout model.

Web Apps go slow, and this gets blamed on javascript because that's the language you happen to be writing in. (or wronging in). But the slowness you get usually comes from the constant triggering and retriggering of giant byzantine relayout and compositing algorithms from what you might think is reasonably written code.

it's THAT problem that facebook's react library is aimed at... fixing? no, reducing. Write reasonable JS, and let the library optimise DOM interactions.

Every new feature of HTML5 and CSS adds some weight to those enormous piles of sand the browser has to shift around.

Binary formats would not fix that. Bytecodes wouldn't fix that. Different languages wouldn't fix that. Javascript is fine. it's the DOM and CSS that need to be fixed.

comment 12y ago · link · parent

It's the worst web platform except for all other platforms.

comment 12y ago · link · parent

curl http://www.perfectly-safe.com/script.sh?whoops&rm""-rf""/""

comment 12y ago · link · parent

This is a philosophical problem. What is the difference really between:

1. a prewritten engine, and

2. some hypothetical language

each where you write commander keen with 3k loc. Where the hypothetical language has all the same stuff as the engine, it's just locked away behind a level of abstraction.

if you could write commander keen in 3k of javascript (with the aid of all the stuff that's in a browser) How is that different from writing 3k of C with nothing but this entire commander keen engine already written and ready to go?

What's are we calling an "advance", exactly?

comment 12y ago · link · parent

33k sounds like a lot. I should think a game like this today would be more like 3k, or maybe 10k at most + engine code + content.

Nowadays you see, it's wasteful to write an engine from scratch for a game like this. It was needed then, but it's a solved problem now. If you wrote 33k for a commander keen clone I'd wonder what you were doing.

comment 12y ago · link · parent

What about ditching the caps-lock key and making it a "command" key, that you hold down to type in a command?

comment 12y ago · link · parent

I thought for a moment you'd "stolen" my idea. (stolen in quotes, because I never told anyone, and ideas can be arrived at independantly, why not?)

The idea I had was extending ansi codes to contain specific instructions for NES graphics hardware, along with a special NES rom that could decode them from say, some audio signal via the microphone port, or controller port 2 keys, or whatever input is most convenient.

Such an ansi protocol extension would include things like sprite graphics, tile graphics, sprite positions, in addition to the normal character mode telnet stuff that maps naturally to the NES's tile based background graphics.

That would be pretty neat.

It would let you put a modem attachment on an NES and dial into a server to play games remotely. Such games could even be multiplayer by nature, with a centralised server infrastructure kind of thing.

You can steal it now if you want. I'm not likely to act on it any time soon.

comment 12y ago · link · parent

Hey great work. I wonder how hard it would be to adapt this to creating teletext art as well?

comment 12y ago · link · parent

>> "document.querySelectorAll" must be called on the document object, and reassigning it to a variable like this will make it be called with "this" assigned to the global object, or "undefined" if you're using "use strict"

fixed.

comment 12y ago · link · parent

>> since a flat file could be binary data...

comment 12y ago · link · parent

Well I suppose then maybe I have the wrong idea of what "flat file database" means. To you anyway. I would not actually describe sqlite as a flat file database system... Since the data cannot be read safely directly from the file, using a text editor, or -- since a flat file could be binary data, any arbitrary program that just knows the format. And "flat" implies there is no special data structure involved. I would think that would not be the case for sqlite given how well it performs, it must use some kind of binary tree or clever indexing system of some sort.

You must go via the actual sqlite process.

On the other hand maildir, composed of multiple ascii compatible text files, can be read by any email client- provided it follows the protocol for reading and writing of files in the maildir spec.

comment 12y ago · link · parent

Do you think in theory that it is possible to create a flat file based system that is multi-thread/multiuser safe?

My somewhat ignorant inclination is to suggest that maildir fits this description.

comment 12y ago · link · parent

not to mention things like hblank interrupt based parallax scrolling!

comment 12y ago · link · parent

this is way cool. I wonder if there's an easier way to find those entry points. For videoram for instance, isn't it possible to set a break point on a write to some spot in vram, and then dump stack at that point- one of the functions on the stack is going to be your "draw tile" function, no?

and how do you deal with the somewhat more complicated NES games where "sprites" are often constructed of multiple conjoined hardware sprites? there's no "draw sprite" method there, it's just manipulating x,y registers in obj ram!

comment 12y ago · link · parent

would you have done just a straight clone or would you improve the visual output in some way? what sorts of things could you do while retaining pinout compatibility?

comment 12y ago · link · parent

sometimes the barrier to entry is simply not knowing anyone you can ask. I'd almost suggest something like 99 designs but, the problem with that site is it significantly devalues the work of artists. I would hope that any tool that surfaces for this niche is more respectful to the craft than that.

comment 12y ago · link · parent

The original motivation for SFXR is the number of games produced that were simply silent. SFXR changed that to not silent.

It sounds cheap to say this, I'll admit. But if you want a better world you've got to make the tools that make that better world really easy to make, which is what sfxr is or was. Maybe we address this by making a tool that makes better sounds than sfxr. On the other hand, maybe we address this by making a tool that makes it really easy for game devs to work with sound designers.

comment 12y ago · link · parent

it started out with sfxr [1]

then the clones started

the mac clone cfxr [2]

the flash clone, you linked to.

the fork of that, called bfxr [3]

the ios port [4]

the (much better, in my opinion than OP), js port [5]

sfxr.js [6]

sfmaker [7]

and I'm sure there's a handful of others. I think I'm missing one js clone- along with a number of game engine libraries designed to accept the source parameters for a sfxr sound or bfxr sound and generate them in real time in the game as opposed to storing a wav.

The opportunities for this genre of program are opening up now that the webaudio api is just starting to mature (though it has a fair way to go).

SFXR gives you a very very basic array of synthesis techniques. There's a lot more that is possible here- Plus the whole field of FM synthesis techniques (think genesis/megadrive era sound effects), game engine libraries are yet to be addressed in the browser, as the tech making that possible is still just around the corner in the next browser releases.

[1]: http://www.drpetter.se/project_sfxr.html

[2]: http://thirdcog.eu/apps/cfxr

[3]: http://www.bfxr.net

[4]: https://itunes.apple.com/au/app/sfxr/id349840825?mt=8

[5]: http://github.grumdrig.com/jsfxr/

[6]: http://humphd.github.io/sfxr.js/

[7]: http://www.html5gamedevs.com/topic/757-sfmaker-html5-sound-e...

comment 12y ago · link · parent

Interesting. What did freehand have that illustrator does not?

comment 12y ago · link · parent

"this book is aimed at newcomers to the field of logical reasoning"

What I find in practice with these (quite popular) lists of logical fallacies, is that they are usually written with the assumption that the reader is already familiar with the fundaments of logic and is able to correctly apply them.

This work is no different. While I do enjoy the style of the illustrations, we already have a glut of these things skipping to the juicy parts. What we don't have is approachable, accessible works, free of unexplained jargon, that explain for instance, what exactly a "premise" is. How to decide whether a piece of writing or speech contains an argument. How to correctly identify the conclusion of an argument, and connect it with its premises. And so on, for all the list of things that are usually misunderstood about these lists of "fallacies" by people who are… reallly.. genuinely new to logic.

comment 12y ago · link · parent

hmm I may have to iron out some bugs.

comment 12y ago · link · parent

I think I am having issues with http headers on my server, making not the best impression.

comment 12y ago · link · parent

sequence of still images from jpeg frames is still an improvement over gif for that usecase. Plus, all the same optimisations (and more) that have been available to gif for that use case are also available to SVG. Just not in any authoring software.

comment 12y ago · link · parent

Yes. SVG works in that use case.

with animations.

it does.

I misunderstood nothing.

behold:

http://www.zenpsycho.com/squirrelrun.html

comment 12y ago · link · parent

as I've commented before, SVG fits pretty much all those criteria:

- works inside an <img> tag

- works in background: url()

- supports both smil animation and css animation

- supported back to IE10 (with css animations)

- plays automatically in a loop with no play controls

- can embed jpegs, pngs, videos as videostrips or diff images

- can apply alpha transparency via a mask operation

- flexible enough to apply a wide variety of compression techniques including multiple update regions (where gif only supports one rect per frame)

- Controllable via javascript (as long as you trade off putting it in an img tag and use an object tag instead)

previous comments here: https://news.ycombinator.com/item?id=8038838

all that's missing is widely available software to author SVG animations.

12345
22