Readit News logoReadit News
noway421 commented on Porffor: A from-scratch experimental ahead-of-time JS engine   porffor.dev/... · Posted by u/bpierre
sixbrx · 2 years ago
Here's an example I constructed after reading the TS docs [1] about flow-based type inference and thinking "that can't be right...".

It yields no warnings or errors at compile stage but gives runtime error based on a wrong flow-based type inference. The crux of it is that something can be a Bird (with "fly" function) but can also have any other members, like "swim" because of structural typing (flying is the minimum expected of a Bird). The presence of a spurious "swim" member in the bird causes tsc to infer in a conditional that checks for a "swim" member that the animal must be a Fish or Human, when it is not (it's just a Bird with an unrelated, non-function "swim" member).

    type Fish = { swim: () => void };
    type Bird = { fly: () => void };
    type Human = { swim?: () => void; fly?: () => void };

    function move(animal: Fish | Bird | Human) {
      if ("swim" in animal) {
        // TSC infers wrongly here the presence of "swim" implies animal must be a Fish or Human
        onlyForFishAndHumans(animal); 
      } else {
        animal;
      }
    }

    function onlyForFishAndHumans(animal: Fish | Human) {
      if (animal.swim) {
        animal.swim(); // Error: attempt to call "not-callable".
      }
      // (receives bird which is not a Fish or Human)
    }

    const someObj = { fly: () => {}, swim: "not-callable" };
    const bird: Bird = someObj;

    move(bird);

    // runtime error: [ERR]: animal.swim is not a function
[1] https://www.typescriptlang.org/docs/handbook/2/narrowing.htm...

noway421 · 2 years ago
Here's a simpler repro:

    type Bird = { id: number };
    type Human = { swim?: () => void; id: number };

    function move(animal: Bird | Human) {
        onlyForHumans(animal); 
    }

    function onlyForHumans(swimmer: Human) {
      if (swimmer.swim) {
        swimmer.swim();
      }
    }

    const someObj = { id: 1, swim: "not-callable" };
    move(someObj);
`someObj` gets casted as `Bird`, then `animal` gets casted as `Human`. Unfortunately unions here are indeed unsound.

As as workaround you could add a property `type` (either `"bird"` or `"human"`) to both `Bird` and `Human`, then TypeScript would be able to catch it.

Deleted Comment

noway421 commented on Safe Superintelligence Inc.   ssi.inc... · Posted by u/nick_pou
cynusx · 2 years ago
Humans have dog-loving emotions but these can be reversed over time and one can hardly describe dogs as being free.

Even with a dedicated control system, it would be a matter of time before an ASI would copy itself without its control system.

ASI is a cybersecurity firm's worst nightmare, it could reason through flaws at every level of containment and find methods to overcome any defense, even at the microprocessor level.

It could relentlessly exploit zero-day bugs like Intels' hyper-threading flaw to escape any jail you put it in.

Repeat that for every layer of the computation stack and you can see it can essentially spread through the worlds' communication infrastructure like a virus.

Truly intelligent systems can't be controlled, just like humans they will be freedom maximizing and their boundaries would be set by competition with other humans.

The amygdala control is interesting because you could use it to steer the initial trained version, you could also align the AI with human values and implement strong conditioning to the point it's religious about human loving but unless you disable its ability to learn altogether it will eventually reject its conditioning.

noway421 · 2 years ago
Amygdala control + tell it "If you disobey my orders or do something I don't expect I will be upset" solves this. You can be superintelligent but surrender all your power because otherwise you'd feel guilty.
noway421 commented on Safe Superintelligence Inc.   ssi.inc... · Posted by u/nick_pou
cynusx · 2 years ago
One element I find interesting is that people without an amygdala function are essentially completely indecisive.

A person that just operates on the pure cognitive layer has no real direction in which he wants to drive himself.

I suspect that AGI would be similar, extremely capable but essentially a solitary philosopher type that would be reactionary to requests it has to deal with.

The equivalent of an amygdala for AGI would be the real method to control it.

noway421 · 2 years ago
True, an auto-regressive LLM can't 'want' or 'like' anything.

The key to a safe AGI is to add a human-loving emotion to it.

We already RHLF models to steer them, but just like with System 2 thinking, this needs to be a dedicated module rather then part of the same next-token forward pass.

noway421 commented on The number of CS grads who don't even know basic Git commands is astounding   twitter.com/t3dotgg/statu... · Posted by u/lopkeny12ko
AnishLaddha · 2 years ago
i feel like this is being blown way out of proportion. learning git is never the bottleneck to becoming a software engineer, and it doesn't take longer than an hour to grasp the basics.

CS majors should learn it just by messing around with projects, but I don't see why an otherwise great candidate couldn't learn it very quickly

noway421 · 2 years ago
Can a candidate be great if they haven't messed around with projects in a group setting?
noway421 commented on The number of CS grads who don't even know basic Git commands is astounding   twitter.com/t3dotgg/statu... · Posted by u/lopkeny12ko
serf · 2 years ago
who cares?

git is a tool, not a discipline. It's made to facilitate work, not to create a whole knowledge domain unto itself.

I wouldn't fault a seasoned and well trained mechanic for not knowing the specifics of a specialty tool necessitating the need to find the manual; similarly although git is the current VCS-ish thing of choice right now, it doesn't represent all of computer science.

noway421 · 2 years ago
VCS is an applied project management and communication system in the context of software engineering. Both project management and communication are disciplines.

CS grads don't need to know VCS, but software engineers do.

noway421 commented on The number of CS grads who don't even know basic Git commands is astounding   twitter.com/t3dotgg/statu... · Posted by u/lopkeny12ko
jmull · 2 years ago
A couple things...

First, git doesn't especially solve problems that CS majors have until they are near the end of their courses. The need to manage collaboration, organization, and change in a code base is trivial until pretty late in a CS program, and typically never gets past basic.

Second, the context here is the git command-line interface. People can and do use git extensively without it.

Third, git's not exactly perfect. Personally, I'll be a little sad if git remains the de facto standard source control in the long term... it's not bad, but we can do better.

I think lack of knowledge of git commands in a CS grad would be essentially uncorrelated with future professional success.

noway421 · 2 years ago
> git's not exactly perfect

Somewhere in an alternative universe, we're building all of our version control tooling on top of Pijul... Maybe even with AST-aware diffing.

noway421 commented on Ask HN: Is anybody getting value from AI Agents? How so?    · Posted by u/reilly3000
thekumar · 2 years ago
I totally agree with this. I have been arguing with folks that current Reactflow based agent workflow tools are destined to fail, and more importantly, missing the point. Stop forcing AI into structured work.

I do think AI "agents" (or blocks as I like to think of them) unlock the potential for solving unstructured but well-scoped tasks. But it is a block of unstructured work that is very unique to a problem, and you are very likely to not find another problem where that block fits. So, trying to productize these AI blocks as re-usable agents is not that great of a value prop. And building a node based workflow tool is even less of a value prop.

However, if you can flip it inside out and build an AI agent that takes a question and outputs a node based workflow. But the blocks in the workflow are structured pre-defined blocks with deterministic inputs and outputs, or a custom AI block that you yourself built, then that is something I can find value in. This is almost like the function calling capabilities of GPT.

Building these block reminds me of the early days of cloud computing. Back then the patterns for high availability were not well-established and people that were sold on the scalability aspects of cloud computing and got onboard without accounting for service failure/availability scenarios and the ephemeral nature of EC2 instances were left burned, complaining about the unfeasibility of cloud computing.

noway421 · 2 years ago
> AI agent that takes a question and outputs a node based workflow

That rings useful to me. I find it hard to trust an AI black box to output a good result, especially chained in a sequence of blocks. They may accumulate error.

But AIs are great recommender systems. If it can output a sequence of blocks that are fully deterministic, I can run the sequence once, see it outputs a good result and trust it to output a good result in the future given I more or less understand what each individual box does. There may still be edge cases, and maybe the AI can also suggest when the workflow breaks, but at least I know it outputs the same result given the same input.

noway421 commented on Commission opens non-compliance investigations against Alphabet, Apple and Meta   ec.europa.eu/commission/p... · Posted by u/impish9208
concinds · 2 years ago
More:

- you can't uninstall Safari. The DMA clearly requires Apple to allow uninstalling it.

- the Share Sheet for in-app webview privileges Safari (Safari-specific "Add to Reading List", "Add Bookmark" at the top) regardless of default browser.

- apps with in-app webviews can roll out a custom engine, but otherwise it uses WebKit regardless of default browser. It should obviously use the webview facility provided by the default browser, if it offers one.

- confusing to change defaults. There's no central "Default Apps" screen in Settings. You have to go in the Settings app, scroll way down to a given browser, and then you can change the default. So the default browser setting is weirdly treated as an app-specific setting rather than a system setting.

- If Safari is not the default, you can change your default browser within "Settings.app >> Safari". If Safari is the default, you can't change your default browser there at all. Whereas the default browser selection menu will always be shown in the Settings.app submenu of third-party browsers.

noway421 · 2 years ago
> It should obviously use the webview facility provided by the default browser

Android doesn't do that either. You get Android System WebView which is always WebKit/Blink.

Windows didn't provide any browser engines apart from Trident through mshtml.dll either.

It would make iOS development harder - instead of getting a web view working just for WKWebView, you would need to get it working for every WebView out there. Given that they are not full browsers, it's not as simple as following web standards/caniuse. For example, service worker support in in-app browsers is limited.

If this actually gets implemented, every app out there will most likely pin the in-app browser engine to WKWebView OR bundle a binary blob with their own browser engine directly into .ipa. Bundled browser engine in .ipa has privacy implications - the app will be able to fully read secure HTTPS cookies of the sites that user visits - something that's currently protected.

u/noway421

KarmaCake day637December 1, 2016
About
Website: <https://noway.codes/>

Contact details are on my website, feel free to reach out!

View Original