Hacker Newsnew | past | comments | ask | show | jobs | submit | veltas's commentslogin

Is it officially weird now that I've never owned a MacBook?

Even if it weren't against the guidelines (which it absolutely is against, as it clearly states you should use the lane for your exit, it's just not illegal or anything you're likely to get penalties for), it's also something you ought not to do.

Society is better off when people do not do the things they ought not to do, even if they are not things they must not do.


I think the first question I've got for JavaScript Forths is how you'd handle addresses, bytes, etc., because that's a staple of any conventional Forth, necessary to create tables, arrays, and handle strings. There are lots of ways of doing it but there are some nasty compromises required for a more standard-looking Forth.

A FORTH in Javascript should do what Clojure does for Java.

The object on top of the stack should be a Javascript value, numbers are all doubles, and you can use strings, arrays, objects-as-dicts and in fact ordinary objects you could write something like

   >> {"a": [1, 2], "b": "hello" }

   >> DUP

   >> "a" GET{ 0 GET[

   >> .

   1

   >> "something" "c" PUT{

   >> .

   {"a": [1, 2], "b": "hello", "c": "something" }
You could use all the metaprogramming tricks you use in other FORTHs, be able to do anything Javascript can do, I don't think it would be too hard to unpack the stack and turn a word that takes N parameters from the stack into a Javascript function the JS compiler can make fast

There is some precedent:

https://www.forth.org/svfig/kk/11-2019-O'Connor.pdf

I just realized there is exception handling in FORTH now

https://forth-standard.org/standard/exception

and wonder if that could be harmonized with JS exceptions

This strategy though competes with writing a Lisp which gives you better metaprogramming.


What about an array of numbers? What are the nasty compromises?

Well if the array of numbers are bytes then that has a pretty significant overhead, and losing a lot of performance for dealing with larger numbers or floats even. If it's not then you're complicating handling of strings and writing off most conventional forth code by not using byte addressing. Etc.

A typical Forth machine has about 64k bytes of RAM, I don't think it's a big deal if you're running JavaScript anyway.

Some Forths work by directly writing machine code. You need to add a fair bit of machinery to be able to turn a JS number array into an executable piece of memory that can be hotpatched into other pieces.

If you're making it in JavaScript then you won't be doing that anyway.

And doing it a different way, is the point I was making?

It comes with an overhead. You have to take a different architecture. You can't do things the same way.


That you can't execute machine code from JavaScript is a consequence of using JavaScript, not a consequence of using an array to store a bunch of numbers.

What about writing primitives using WASM?

WCPGW = What Could Possibly Go Wrong, for everyone else that will have to google that.

I agree but at the same time I've noticed a lot of ESL people use a smile emoticon like it's a period, and it doesn't really mean anything except to be friendly, but it doesn't come across that way.

It's GNOME Toolkit now, you're not wrong, but originally was GIMP.


Much like adding an extra lane to a highway, more people will use the highway and you'll be back to the same crawl. But technically there's more flow/capacity.


Curious that you are being downvoted for the car analogy when the bus analogy you're replying to is functionally identical.


Because it’s a slightly different argument. “More people will use the highway” is not really applicable here. The bus analogy also didn’t meant “more people will take a bus”, just that if you have bus route where 20 people on each bus stop need to wait for the next bus, if you increase capacity of buses by 10, then only 10 people will be waiting on bus stops, but you will still have 100% bus utilization.

In other words, with added lane on highways, it’s sociological mechanism, which is slightly less precise analogy.


If you run the same bus route and frequency, one day with buses that fit 50 people and have 100% utilization, and the next day with buses that fit 100 people and have 100% utilization, you transported twice as many people on the second day as on the first day

This implies that on the first day a lot of people either didn't make their trip because there was no space, or took a different mode of transport. Presumably mostly the latter. With the highway example the same is true, just that it will be mostly people not making the trip at all before the capacity improvement because they were unwilling to make the higher time commitment


Amazing they're called 'laptops' when you haven't been able to safely keep a laptop on the top of your lap for decades.

Even slight increases in temperature is enough to do damage to certain parts of a man, and it's really not good for your legs to have this extremely hot air blasted over it continuously.


Are they ever safe? Aside from Atom and maybe the AMD equivalent, they've always been hot when not idling. And those Atoms are so tiny you might as well just hold them in your hand


Imagine being able to steal billions in crypto from your work laptop and using same laptop to run code sent to you by another company. I wish I had their problems.


I don't associate with the author that well here because I'm not hyped about 'arena allocators' and I don't really care that free doesn't receive a size. I think the interface was okay.

Also 'arena allocators' (this meant something different like 20 years ago so I think the name just got rebranded) are not that good, they make some things easier and improve performance sometimes, they also are liable to use more memory and cause more fragmentation if not used with care. That is one of the many reasons why we slowly evolved away from the old linear allocators, but also because we just wanted a simple and flexible interface to hide complexity.


Arena/linear allocators have their place. In real-time systems they are fantastic to reset quickly and bypass having to interact with the kernel.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: