HNHacker News
TopNewBestAskShowJobs

upghost

1,418 karma · joined December 17, 2022

submissionscomments
upghost··on Earthstar – A database for private, distributed, offline-first applications
Damn, preach. Epic defense of privacy, doodlebugging. Thank you for giving voice to my thoughts.
upghost··on Show HN: I built a full mulimodal LLM by merging multiple models into one
Nice! To be clear for my usecase I didn't mean calling the local LLM directly, rather simply being able to point to an OpenAI compatible API would be fine. It seems like wrangling a native model would be a lot of extra complexity, but you seem to have a very good abstraction story here. Actually I probably will take a peek at the code to see how you are doing these abstractions layers, because the user facing API is certainly very clean...!
upghost··on Show HN: I built a full mulimodal LLM by merging multiple models into one
I'll jump in before the haterade engine wakes up -- great bit of engineering work here! I can't imagine a better level of abstracting away the unnecessary stuff while still retaining that level of manual control.

The only thing I don't see is setup for local/in-house LLMs, but it's easy enough to spoof OpenAI calls if necessary.

upghost··on Fixing left and mutual recursions in grammars
Thanks, I've been looking for this for a long time!
upghost··on Auto-Differentiating Any LLM Workflow: A Farewell to Manual Prompting
> - the task of crafting textual inputs to effectively direct LLMs -- remains difficult and labor-intensive

Damn, I knew we were lazy but describing prompting as labor-intensive is impressively lazy even to me.

Obviously reading the rest of the abstract was too labor intensive for me but I'm hoping I can just hook a probe up to my drool and it can infer my desires from that.

upghost··on Gradual Disempowerment: How Even Incremental AI Progress Poses Existential Risks
Obviously scary AI future means we should probably give full regulatory capture to a handful of wealthy individual corporations. You know. For our own safety.
upghost··on Dead Games
Steam page that I can wishlist yet?

God speed.

upghost··on From C++ to Clojure: Jank language promises best of both
Curious what the story is for slotting Jank into gaming. Seems like a fit for Unreal, but I really love the Component-Based-Architecture of Unity. Would you get it into your Unity project the same was as getting normal C++ into your project?
upghost··on A major Postgres upgrade with zero downtime
I can't believe they took the time to make such an amazing write-up. With formatting and everything. Normally I just grab whatever broken crayon is closest and scribble on the back of an overdue bill "don't fsck up next time"
upghost··on I do not want AI to "polish" me
You had me at

> "why would I want to translate my email into Polish?"

upghost··on Using uv as your shebang line
Oh my god this is amazing. We need to fix some of the IO redirect in Scryer and then this will be a perfect replacement for bash scripts <3

You rock!

upghost··on The Simplicity of Prolog
I will concede that my tone was not as welcoming or polite as it should be and could rightly be considered combative, so please accept my apologies.

> call_direct_and_indirect(IndirectCallTarget, Input, Result) :- call_direct(Input, Intermediate), % first-class call call(IndirectCallTarget, Intermediate, Result). % second-class call

I see we are at an unfortunate impasse. I assert what you are calling a "second-class call" is usually considered "first-class". I will leave the definition here for readers to decide for themselves. I rest my case and wish you a good day.

https://en.wikipedia.org/wiki/First-class_function

> Higher-order functions: passing functions as arguments

  Further information: Higher-order function
  In languages where functions are first-class citizens, functions can be passed 
  as arguments to other functions in the same way as other values (a function 
  taking another function as argument is called a higher-order function). In the 
  language Haskell:

  map :: (a -> b) -> [a] -> [b]
  map f []     = []
  map f (x:xs) = f x : map f xs
upghost··on IAC confirms existence of a Super-earth in the habitable zone of a Sun-like Star
I asked a physicist friend about this. At 6x mass, it would only be 6x the gravity if it was the same size as Earth. Depending on the density, the gravity could actually be weaker than Earth!
upghost··on The Simplicity of Prolog
First of all lets be clear: the concepts of "first class" and "callable" are procedural terminology coming from object oriented and functional languages. I am admitting them to the discussion for purposes of comparative language analysis. My criteria is "if a reasonable person would recognize a language construct in Prolog as similar to an equivalent language construct in an OO or FP language, we can discuss it as if it were the same".

However, this is a charitable interpretation that is open to abuse if desired.

It is starting to sound like the criticism is that Prolog is not an object oriented programming language and does not pass contextual object information along with symbols in the same way SICP-style higher order functions are treated in functional programming languages.

This is by design, Prolog is a logic language that describes relationships, not a procedural language.

There is no behavioral difference that distinguishes a Prolog predicate as not "first class". There are many metapredicates designed to accept predicates as arguments, such as maplist/N. This is the primary criteria for supporting first class "callables" (another word poorly suited for Prolog, but I'm admitting it for purposes of conversation) in other languages. I would have assumed that would be a sufficient behavioral affordance.

> there are first-class callable things and second-class callable things

To make this more concrete, please provide some examples of "first-class" and "second-class" "callable things" in Prolog, as well as an example of "first class" and "second class" "callable things" in another language.

Given your level of confidence in your argument, I assume this should be fairly easy to do. Then we might have a concrete basis for discussion.

upghost··on Run DeepSeek R1 Dynamic 1.58-bit
Thanks for the run instructions, unsloth. Deepseek is so new it's been breaking most of my builds.
upghost··on The Simplicity of Prolog
I think there is some confusion around what is "first class" in Prolog. Any syntactically valid construct in (ISO-conforming) Prolog is "first class", including the symbols that are the names of predicates. The fact that Prolog is a homoiconic language makes any valid Prolog code "first class".

"First class" meaning, can be the arguments to a predicate or processed as data.

Predicates (and only predicates) can be called with `call/N` -- although you could write a meta-interpreter with different properties. You could pass in the number `1` and call a randomly determined predicate, as an absurd example.

Perhaps you mean, "the head and body of a predicate are not first class" ? This again is false. They are valid data and can be processed as such -- please see [4] for clarification.

Perhaps you mean "they cannot be looked up dynamically at runtime" -- this is also false, please see [3].

Are there other eligibility requirements for "first class" that we should discuss?

upghost··on The Simplicity of Prolog
Datascript is very similar to Datomic, except that it runs in ClojureScript and is an in-memory datastore with no concept of history or point-in-time queries. The schemas are also much looser than Datomic.

Otherwise, many syntax and semantics are similar.

No dependency on Datomic as Datomic is Java and DataScript is JavaScript.

upghost··on The Simplicity of Prolog
> Could you elaborate on all of these?

Certainly.

> For [1], you would either need to pass the AVL tree around or to have it as a global (which is not wanted), and instead pass the key (the "this" context which is different for different mazes) for the context around.

Not sure how tracking references is different here than any other programming language. Passing objects around is pretty common in OO programming. An AVL tree is just the underlying abstraction used to implement the object. You don't have to implicitly supply the "this" parameter to each "object" predicate if you don't want to -- you could insert that yourself via compilation (with term/goal expansion)[4] or interpretation (via meta-interpreters) if you were really interested in that level of syntactic sugar.

> For [2] again you have a global table (with copying semantics as for assert/retract? or maybe without copying? the docs don't say). But again you would need to pass a key around.

You could use global or local semantics as desirable. The blackboard has a global version that is persistent across application state or a local version that provides lexical context which unwinds on backtracking. Not sure how "passing a key around" is different than most other forms of programming, but if you wanted to compile it away, please review the techniques listed above.

> [3] is... yeah. I mean, sure, you could demonstrate this with a toy metainterpreter on a toy example. But do you really want to run your whole application inside a metainterpreter?

A "toy" meta-interpreter? Meta-interpreters are as fundamental to Prolog as for-loops are to Python. Certain applications, such as games, are run "entirely inside a loop", so I'm not sure how this criticism applies. You can run as much or as little of your application inside a meta-interpreter as you want. The value proposition of Prolog is that the simple homoiconic syntax allows for powerful meta-interpretation. I'd suggest checking out the video I linked to in [3] if you have doubts on that topic.

> One could also abuse DCG syntax, with the context being some state object instead of a DCG list.

State transitions (a sequence of states) are a great use for DCG syntax! I wouldn't call that "abuse".

> A more practical way would be Logtalk-like code generation. The most practical way would be actual Logtalk.

If you are willing to give up the most powerful features of Prolog, sure.

> Unfortunately, last I heard Scryer refused to host Logtalk for no real reason.

Hmm, I wonder if that's the real story :)

[4]: Please see Section 3 of my talk if you are interested in a more thorough explanation of goal/term expansion. https://docs.google.com/presentation/d/e/2PACX-1vR4Q0Ohs66mj...

upghost··on The Simplicity of Prolog
A lot of these comments don't make any sense to me.

> Prolog predicates are not first class values.

Predicates are trivially called, even as variables, with the `call/N` metapredicate.

> Mapping and filtering is awkward

In what sense? The declarative semantics...?

> Arithmetic is awkward

In what sense...? Have you seen clpz?

> The CLP examples aren't integrated with Prolog's Horn clause resolution model

In what sense...? clpz and clpb do this magnificently.

> Indexing and search strategies are not under programmer control.

Most ship with SLG resolution or you can write your own resolution strategy with a simple metainterpreter as an intermediate exercise -- but SLD resolution is already pretty good. In general not needing to think about the indexing and search strategies are a highlight of the declarative semantics of Prolog, its odd to see someone with a "long standing love affair with Prolog" list this as a drawback.

> Modes are awkward.

Modal programming is a defining feature of Prolog. Tell me more about this "long standing love affair", again?

> I've been an enthusiastic Prolog programmer since the mid 1980s

If you are still struggling with mapping, filtering, arithmetic, `call/N`, and CLP in Prolog after nearly 45 years of "enthusiastic" programming, I'd highly recommend checking out Triska's Power of Prolog videos for some guidance, I think you will find them very illuminating.

https://youtube.com/@thepowerofprolog

upghost··on The Simplicity of Prolog
Ok just to clarify, Datomic is a Clojure thing. It is free to use but closed source. It is an excellent database that is used, owned, and financed by Nubank, the largest and most rapidly growing bank in Brazil.

It is not Datalog syntax but heavily inspired by Datalog.

I'm throwing this in here just for clarification, I don't want to see Datomic as collateral damage in this conversation.

upghost··on The Simplicity of Prolog
There are multiple ways to accomplish this, but the one that is the most straightforward is to simply make an object mapping of the type you are familiar with via AVL trees[1]. Easy way to get the "this.maze" semantics. You can get global context and local context via "blackboard"[2] semantics.

However quite frankly the most powerful way to do this is not obvious because it doesn't translate well to other languages: meta-interpreters[3].

[1]: https://www.scryer.pl/assoc

[2]: https://www.scryer.pl/iso_ext.html#bb_get/2

[3]: https://youtu.be/nmBkU-l1zyc

upghost··on The Simplicity of Prolog
Maybe watch the second link I posted?
upghost··on The Simplicity of Prolog
No, unless you count cancer research[1], particle physics experiments[2], and government funding allocations[3].

[1]: https://dcnorris.github.io/precautionary/index.html

[2]: https://github.com/mthom/scryer-prolog/discussions/2441

[3]: https://link.springer.com/chapter/10.1007/978-981-97-2300-3_...

Regarding how, check out Power of Prolog on YouTube.

upghost··on The Simplicity of Prolog
Respectfully have to disagree. Prolog has the best features for abstraction of any language I've used, I suspect it may be near an optimal fixed point for metaprogramming expression[3]. I will say the other side of that wall is breathtaking.

Also not sure what you mean, CLP is a first class consideration in many Prologs, esp Scryer Prolog. Check these crazy demos out:

[1] https://youtu.be/h5Xy4YjCZxM

[2] https://youtu.be/5KUdEZTu06o

Just look at this Sudoku solver code (see [2] for explanation):

  sudoku(Rows) :-
        length(Rows, 9),
        maplist(same_length(Rows), Rows),
        append(Rows, Vs), Vs ins 1..9,
        maplist(all_distinct, Rows),
        transpose(Rows, Columns),
        maplist(all_distinct, Columns),
        Rows = [As,Bs,Cs,Ds,Es,Fs,Gs,Hs,Is],
        blocks(As, Bs, Cs),
        blocks(Ds, Es, Fs),
        blocks(Gs, Hs, Is).

  blocks([], [], []).
  blocks([N1,N2,N3|Ns1], [N4,N5,N6|Ns2], [N7,N8,N9|Ns3]) :-
        all_distinct([N1,N2,N3,N4,N5,N6,N7,N8,N9]),
        blocks(Ns1, Ns2, Ns3).
I have yet to see more elegant code in a general purpose language.

[3]: https://github.com/mthom/scryer-prolog/discussions/2347#disc...

upghost··on The Simplicity of Prolog
I always enjoy reading positive pieces about Prolog but without touching on the implications of the principles on display, this article may do more harm than good.

You would ask reasonable questions like, "for God's sake, why?". It feels like you wouldn't use Prolog for anything besides an intellectual game.

Regarding the why:

Some of those reasons include Definite Clause Grammars, Meta-Interpreters, 1st class constraint logic programming, reified conditionals, and term/goal expansion.

There are a lot of exciting modern advances with Prolog, especially Scryer Prolog.

Check out Power of Prolog and get your mind blown: https://youtube.com/@thepowerofprolog

upghost··on PhysicsForums and the Dead Internet Theory
I'm also noticing there's a dead economy theory or at least dead job market theory. AI sending resumes, AI reading/rejecting resumes. Humans wanting to talk to real humans, but all we get is slop. If we ever develop AGI I guess we'll have to go back to completely offline just to talk to real humans.
upghost··on Looking for work is a full time job
What kind of dystopian nightmare do we live in than LinkedIn is now basically required to get a job? We built this nightmare too. Darn it.
upghost··on Supercharge vector search with ColBERT rerank in PostgreSQL
If this is true, my understanding of vanilla token vector embeddings is wrong. my understanding was that the vector embedding was the geometric coordinates of the token in the latent space with respect to the prior distribution. So adding another dimension to make it a "multivector" doesn't (in my mind) seem like it would add much. What am I missing?
upghost··on Rule-Based Programming in Interactive Fiction
Strangely enough, IF7 was the first thing to make it "click" for me how declarative logic could be used for general purpose logic programming, which shortly thereafter led me to Definite Clause Grammars, Marcus Triska's work on Definite Clause Grammars[1], and (like this comment) was the gateway drug to (Scryer) Prolog, and Prolog used not just for niche applications but for general purpose computing.

Of course I since realized that was the tip of the iceberg.

[1]: https://youtu.be/CvLsVfq6cks

upghost··on Ask HN: How can I realistically change careers?
Not the answer I wanted but the answer I needed. I am culturally enriched, thank you.

https://www.seattletimes.com/entertainment/pagliacci-classic...

← PreviousPage 6 of 13Next →