Live data from Hacker News

Coroutines in C (2000)

chiark.greenend.org.uk

31–40 of 61 posts

Re: Coroutines in C (2000)

#31

Has anyone used these to write interrupt service routines? Seems like there's an opportunity here. You can take your existing synchronous code and not have to rewrite it into something like continuation-passing style. This is a source of a lot of bugs.

I have, it's not pretty either: https://github.com/nraynaud/webgcode/blob/gh-pages/interpola...

Re: Coroutines in C (2000)

#32

Earlier quoted context omitted.

You probably shouldn't have your browser in full screen mode on a 27" screen

why?

Because unless you are using huge fonts there is probably a better use case for all they screen space.

I have a 24" (16:9) screen turned 90°, which works wonders for full screen web pages.

Re: Coroutines in C (2000)

#33

Earlier quoted context omitted.

You probably shouldn't have your browser in full screen mode on a 27" screen

why?

Because it's not ergonomic. You don't need the browser to take up your entire screen, you just need it big enough so you can fit the content comfortably.

Admittedly we would all lose this habit quicker if resizing windows wasn't such a finicky process in most OSs

Re: Coroutines in C (2000)

#34
post #27

I guess one of the applications of Coroutines could be WebAssembly. When you run WebAssembly on a website which needs 100% of the CPU for more than a few ms, you have to use the "setTimeout(fn, 0)" trick to prevent the "this website stopped responding" message. That means you have to store the current state at some point and continue in the function fn (after waiting 0 ms). Languages which support coroutines out of t…

Aren't Web Workers (which can run WASM) supposed to fill that role?

Re: Coroutines in C (2000)

#35
post #30
post #26

Earlier quoted context omitted.

The only issue of these websites is the width: using the full width of the screen is just too much for reading. If you add {max-width: 60em; margin: auto;} to the body tag it looks much better.

Back in the day, we had multiple windows on the screen at one time, so this wasn't a problem. I think it was Windows which defaulted to full-screen, and led to the plague of sites assuming that the browser would be full-width on a landscape screen, but I could be wrong. Although I love using a tiling window manager now, I kinda miss my old System 8 Macintosh setup, with Netscape open in one window & Think C (or was i…

On a Mac, Spectacle gets you pretty much there.

I haven't found something similar for Windows, but I'm sure there is one.

Re: Coroutines in C (2000)

#36

Earlier quoted context omitted.

You probably shouldn't have your browser in full screen mode on a 27" screen

why?

It really shouldn't be the web designer's job to pick a width that the content will display as and impose that unilaterally on everyone.

That way it's easy for everyone to make their own choices. If you want 27" wide lines of text, go ahead and full-screen that browser and have at it. If you want the text you're reading to take up less horizontal real estate than that, then you can easily make the browser itself as wide or narrow as you like.

Re: Coroutines in C (2000)

#37
post #21

Earlier quoted context omitted.

> easy to read. Not on 27" with browser in full screen.

CTRL and + to zoom in on Windows/Linux CMD and + to zoom in on Mac or CTRL/CMD and scroll wheel to zoom in/out depending on direction scrolled. Or are you using an ancient browser without zoom?

[deleted]

Re: Coroutines in C (2000)

#38

Earlier quoted context omitted.

You probably shouldn't have your browser in full screen mode on a 27" screen

why?

This is an "it depends" thing.

If you're viewing documents, they're typically more vertically than horizontally oriented. That is, the parts you need to see more of are above/below of the viewable portion, not left/right of the viewable portion. So a browser being used for reading is often more useful when it takes up maybe half the screen on a high-res/large monitor.

If you're accessing webapps, that have more objects arranged horizontally, then going fullscreen may be more useful (think Trello boards and other things).

Re: Coroutines in C (2000)

#39
post #26

That page uses very simple HTML. Just paragraphs of text divided into sections with headings. Some code examples laid out side-by-side with a table. Tiny stylesheet. No JS. Loads quickly, easy to read. Warms the cockles of my heart.

The only issue of these websites is the width: using the full width of the screen is just too much for reading. If you add {max-width: 60em; margin: auto;} to the body tag it looks much better.

Not too wide for my browser windows, which are a bit under 50% of screen width.
Post reply on HN