Live data from Hacker News

WebAssembly COBOL Pong

moxon6.github.io

11–20 of 36 posts

Re: WebAssembly COBOL Pong

#13

I heard COBOL skills are in demand these days in the US.

And now you know why: to reboot Half Life in the browser, leveraging a well-known, time-tested programming language with wide and deep support.

Re: WebAssembly COBOL Pong

#14
Cool!

What's the deal with the alternator function (in app.js)? Why should keypresses be read only on every other attempt?

Also, is there some kind of implicit sleep or requestAnimationFrame somewhere? Or is it busy-looping and polling for key presses as fast as it can?

Re: WebAssembly COBOL Pong

#15
post #14

Cool! What's the deal with the alternator function (in app.js)? Why should keypresses be read only on every other attempt? Also, is there some kind of implicit sleep or requestAnimationFrame somewhere? Or is it busy-looping and polling for key presses as fast as it can?

The emscripten JS will keep "prompt"ing for new input until it receives a null (due to the user pressing escape on the dialog)

This is just a hack around that to simulate entering a value and then pressing escape on the next prompt request

Re: WebAssembly COBOL Pong

#18
post #16

When I view the source code, it's just a javascript file, https://moxon6.github.io/cobol-js-emscripten/cobol-js/index.... where is the cobol?

You mean this file?

https://github.com/moxon6/cobol-js-emscripten/blob/master/co...

I am still looking around so may be wrong.

Re: WebAssembly COBOL Pong

#19
post #16

When I view the source code, it's just a javascript file, https://moxon6.github.io/cobol-js-emscripten/cobol-js/index.... where is the cobol?

You mean this file? https://github.com/moxon6/cobol-js-emscripten/blob/master/co... I am still looking around so may be wrong.

I was looking to see how it is included on the actual website, do you reference a web assembly file from javascript ?

Re: WebAssembly COBOL Pong

#20
post #16

When I view the source code, it's just a javascript file, https://moxon6.github.io/cobol-js-emscripten/cobol-js/index.... where is the cobol?

That's the JS generated by emscripten for linking in the WASM, which is `index.wasm`

`index.wasm` is built using the build scripts in the source repo

`main.cob` contains the main logic used to generate `index.wasm`

https://github.com/moxon6/cobol-js-emscripten/blob/master/co...

Post reply on HN