alexmingoia

Joined 12 years ago

Karma
2,083
Submissions
843
Member since
Aug 3
https://alexmingoia.com

Read the entire Internet at once: https://sumi.news

View on Hacker News

Recent submissions

Comment · 4 years ago
I love this :)
Comment · 4 years ago
We'll still use that 0.5% for something else, right? It's not as if power generation (and emissions) will be reduced.
Comment · 4 years ago
Why is that?

To be clear the lack of “shared” dependencies does not necessitate code duplication. By shared dependencies I’m talking about languages (Haskell for example) where only one version of a library can be used, which results in the diamond dependency problem (predictably so!).

Let’s say file A references file B and C, and files B and C both reference D. D doesn’t need to be duplicated.

If all includes are qualified/namespaced there is no diamond dependency problem, and the compiler/runtime can reuse the same code for multiple references to the same file.

Comment · 4 years ago
Use a modular view/component, or a class using tailwind's @apply directive. It's the best of both worlds.
Comment · 4 years ago
Can you give an example of why you need non-terminating semantics? Programs can still be run "forever", if they are run for each input while maintaining terminating semantics for deriving output. Abstractly the Turing machine is infinite, but in the real world input and output is almost always finite and discrete.

I guess you wouldn't be able to use it to build a machine that is supposed to display Pi or Fibinocci?

Comment · 4 years ago
No higher order functions means that you cannot make a function that takes another function as input or returns a function as output. I would prefer a programming language to be simple, only allowing functions which transform finite input to finite output.

No modules / namespaced includes means that to include other code, you would write something like `include as Foo './other-source-code.file'` or `include as Bar 'github.com/foo/bar/some/source.file@commit`. All the names in the included file (functions, names of data, etc.) would be referenced by prefixing the namespace, like `Foo.baz` or `Bar.baz`. Combine that with the ability to include code via URL, and there would be need for a package manager or separate package manifest. Wherever you want to use the new version/code you simply update the include statement at the top of the file.

Comment · 4 years ago
The diamond dependency problem is easy to avoid: Only allow namespaced/qualified includes, no shared libraries. There is no need for a package manager if the runtime does the work of resolving all includes, and these references have some kind of cryptographic integrity.

This can be completely transparent to the user. There's no need to have a separate program do dependency resolution when dependencies are referenced in source code. Instead we have the complete waste of life that is package manifests and shared libraries.

Comment · 4 years ago
Databases are useful. Look at Datalog and SQL and you're looking at a language that does very useful stuff without user-defined types, higher-order functions, recursion, etc.
Comment · 4 years ago
You don't solve the halting problem. You don't introduce it in the first place by making a Turing complete language.

Datalog is terminating. Programming languages don't have to allow infinite loops and recursion. There are plenty of ways to ensure recursion is terminating, like structural recursion or only allowing recursing finite data structures.

Comment · 4 years ago
- One executable that is the runtime, accepting one argument: the source code file.

- No linters. Code is auto-formatted.

- No modules. Includes can be namespaced/aliased.

- No package manager. Include by Git URL with tags.

- No type annotations. Automatic type-checking.

- No user-defined types. A few good types is better.

- No null. Set membership with maps is better.

- No exceptions.

- No loops. List and map comprehensions.

- No general recusion. Only tractable transitive closures (ala Datalog).

- No higher-order functions.

- Terminating. All programs terminate. Turing completeness is not desirable for most domains, but predictable semantics is.

- Safe. No undefined behavior. No crashes.

- Persistent, the runtime is also the database. The language is the database.

I'm working on a language with exactly this set of features. Email me if you're interested.

Comment · 4 years ago
It doesn’t have to be either or. Provide a toggle for the user to choose their preference.
Comment · 4 years ago
You don’t have to have a passion. It may be more helpful to understand “do what you love” to mean “don’t spend your time doing something you hate or living for other people”.
Comment · 4 years ago
Comment · 4 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton