Better HN
topnewbestaskshowjobs
Log inSign up

andreypopp

1,040 karma · joined Jun 30, 2011 (15y ago) · 179 submissions

just sitting there, looking shiny...

https://github.com/andreypopp https://twitter.com/andreypopp

Submissions

comment 2w ago · link · parent

How did you use it? I was using it as "implementor" subagents orchestrated by opus 5.5 and it was pretty good and fast.

comment 1mo ago · link · parent

hehe, I also have done the same, but I'm building on top of tmux. Though much more minimal in scope. https://kido.tools (website showcases the TUI only but there's native macOS app in the PR which I'm using but still refining).

We should compare notes!

comment 1mo ago · link · parent

You meant Pragmata Pro :)

comment 1mo ago · link · parent

Agree, but this orthogonal to JS or bash question. (I mean can always run some bash locally as well, even wasm compiled one).

comment 1mo ago · link · parent

it cannot use cat but you can make a command which communicates back to agent. Armin mentions that:

> While in theory the agent could provide a CLI tool that talks to the outer harness via environment variables and Unix sockets, it’s a rather crude process

But I don't know why it's crude to be honest. I'm running pi in tmux and have a CLI to prompt it from any shell session / neovim and it works good. So such way of communication is already needed besides codemode.

JS was chosen probably because (1) it's easy to sandbox (there's QuickJS) and (2) (my guess) some models are probably post-trained on JS Codemode.

comment 1mo ago · link · parent

There's no limitation, just have bash commands `read` or `view_image` which communicate back to agent.

comment 6mo ago · link · parent

Cmd+Tab works on iOS on iPad, when keyboard is connected, not sure about iPhones

comment 1y ago · link · parent

try clickhouse-local, it's amazing how it can crunch JSON/TSV or whatever at great speed

comment 1y ago · link · parent

> this also seems a way to declare types for your own code in an external file, thus keeping your code as runnable Lua and benefiting from type checking too

The declaration file isn't used to typecheck the code the declaration is for. It is only for consumers of the code.

comment 2y ago · link · parent

checkout http://docopt.org then

comment 3y ago · link · parent

Would be interesting to know what’s the plan regarding supporting effects in melange. IIRC jsoo (the another OCaml to JS compiler) is doing some whole program analysis to compile to efficient CPS.

comment 3y ago · link · parent

Does it (Dart, C#) support exhaustivity checking for such matching over subclasses?

comment 3y ago · link · parent

Agreed here, it's impressive how easy it is to use and how performant it is.

Would be nice to add a seamless ability to call executable UDFs from clickhouse-local, last time I checked clickhouse-local required executables to be in a special directory (as in proper clickhouse). Instead it'd be nice to be able to reference any executable in an ad-hoc way.

comment 3y ago · link · parent

OCaml has a similar thing but purely on syntactic level — http://jobjo.github.io//2019/04/24/ocaml-has-some-new-shiny-...

comment 4y ago · link · parent

BQN brings back joy of programming for me — I was using it for Advent Of Code 2021 and it was so much fun.

Also check out BQNPAD[1], the online BQN REPL built with codemirror (syntax highlighting, history).

[1]: https://bqnpad.mechanize.systems

comment 4y ago · link · parent

To be honest it seems vim/neovim ticks all those points already.

comment 4y ago · link · parent

CodeMirror 6 is an awesome piece of software and very flexible — I was even able to build a notebook UI with it — https://bqnpad.mechanize.systems/notebook — this is a notebook (WIP) for BQN[1].

The nice thing is that the whole notebook is a single CodeMirror editor with cells stored as ranges in CodeMirror state. This way intercell actions like selection/copy/paste are possible and still you can control execution per cell.

Shortcuts at https://bqnpad.mechanize.systems/notebook

* Shift+Enter to eval cell

* Cmd-Enter to create new cell

* Cmd-Option-Enter to split cell at cursor

* Cmd-Backspace to join cell with the previous one

[1]: https://mlochbaum.github.io/BQN/index.html

comment 4y ago · link · parent

It's very cool to see ngn/k on the HN front page.

After the recent AoC which I've attempted to solve with BQN[1] (another array language) I've got interested in array languages and now exploring K too.

K seems like a nice blend between an array language and a lisp: list is a primary data structure in K, no multidimensional data. K is good at symbolic workloads as well — visit http://nsl.com for some examples.

Also, make sure to check out the C code style ngn/k is written with :-) another K implementation Kona (uses similar C code style) has a wiki page with explanation[2].

[1]: https://mlochbaum.github.io/BQN/index.html [2]: https://github.com/kevinlawler/kona/wiki/Coding-Guidelines

comment 4y ago · link · parent

It's impressive that the entire thing is in pl/pgsql (apart from parsing).

Have you considered any other implementation strategies (C native extension, any other pl/* or maybe running an out of PostgreSQL process which does GraphQL to SQL compilation)?

comment 4y ago · link · parent

Lua in nginx can you get very far in my experience.

comment 4y ago · link · parent

> What’s wrong with opam?

I'd say the main problem is that local switches and lock files are still not the default mode of operation.

Also opam lacks a global cache of built packages which esy provides (esy's cache is modelled after Nix package manager). So every new opam local switch effectively compiles everything from scratch. Though, as I understand this aspect is going to be addressed by dune at some point (though esy caches not just OCaml built artefacts but also C/C++).

(Full disclosure: I'm biased as I'm one of the original developers of esy)

comment 4y ago · link · parent

Specification isn't being followed is of course useless. But yeah, tests are definitely useless and in the absence of the spec is the only sane way to approach such rewrite.

comment 4y ago · link · parent

Well... How many paid work hours spent on tsc? Then does TypeScript have a formal language specification? I'm pessimistic it's possible to rewrite tsc with full compat (bug-to-bug, otherwise it doesn't really make much sense) without MS support... but who knows... I'd like fast compiles too, so good luck!

comment 4y ago · link · parent

Given the recent posts about compile-to-SQL languages, I thought I'd post here a link to FunSQL.jl which is another interesting point in the design space and which, I think, has quite a few really useful design decisions.

The library presents an API of combinators for query construction but it's totally possible to build a concrete syntax around it (in fact I did it for my port in OCaml). But syntax isn't really this important (it is of course) but the compositional semantics FunSQL.jl provides:

1. Query combinators can be composed together in any order (if they are "compatible") unlike SQL where structure SELECT .. FROM .. WHERE .. is rigid:

    from users
    where is_active
    select username
(also `from` being the first combinator makes code completion much powerful).

2. The way FunSQL.jl treats `group by` as just another kind of namespace, aggregates are then specified as just expressions under this namespace:

    from users as u
    join (from comments group by user_id) as c on c.user_id = u.id
    select
      u.username,
      c.count() as comment_count,
      c.max(created_date) as comment_last_created_date
In the example above the `c` subrelation is grouped by `user_id` but it doesn't specify any aggregates - they are specified in the `select` below so you have all selection logic co-located in a single place.

This is a really useful feature, from my point of view, as it's allows you to construct re-usable query fragments first and then combine them to build complete quries.

3. In other aspects FunSQL.jl is really close to SQL which I think is a big plus as well — familiriaty.

25.

FunSQL.jl – Julia library for compositional construction of SQL queries(github.com ↗)

25 points · by andreypopp · 4y ago · 1 comment

comment 4y ago · link · parent

FunSQL.jl requires Julia to run (obviously as it is a Julia library) but it produces standard SQL so Julia in this case is just an implementation language.

I have re-implemented parts of FunSQL in Python and OCaml (the one I have ended up using) and have added a concrete syntax similar to what you have in PRQL.

    from employees
    define
      salary + payroll_tax as gross_salary,
      gross_salary + benefits_cost as gross_cost
    where gross_cost > 0 and country = 'usa'
    group by title, country
    select
      title,
      country,
      avg(salary) as average_salary,
      sum(salary) as sum_salary,
      avg(gross_salary) as average_gross_salary,
      sum(gross_salary) as sum_gross_salary,
      avg(gross_cost) as average_gross_cost,
      sum(gross_cost) as sum_gross_cost,
      count() as count
    order by sum_gross_cost
    where count > 200
    limit 20
But, in my mind, the biggest difference between PRQL and FunSQL is the way FunSQL treats relations with `GROUP BY` - as just another kind of namespaces, allowing to defer specifying aggregates. A basic example:

    from users as u
    join (from comments group by user_id) as c on c.user_id = u.id
    select
      u.username,
      c.count() as comment_count,
      c.max(created_date) as comment_last_created_date
The `c` subrelation is grouped by `user_id` but it doesn't specify any aggregates - they are specified in the `select` below so you have all selection logic co-located in a single place.

I think this approach is very powerful as it allows you to build reusable query fragments in isolation but then combine them into a single query which fully specifies what's being selected.

comment 4y ago · link · parent

I’m learning BQN while solving AoC puzzles.

While this is my first array language and I cannot compare with others I like BQN very much:

- excellent documentation

- small but excellent community

- context free grammar

- good text editor support (I’m using neovim)

- FUN!

comment 5y ago · link · parent

See "Kindly Bent to Free Us"

https://dl.acm.org/doi/pdf/10.1145/3408985

comment 5y ago · link · parent

Upcoming OCaml multicore won't expose effects at all. I believe the intention is to finish work on typed effects[1] and only then add it to the language.

[1]: https://www.janestreet.com/tech-talks/effective-programming/

comment 5y ago · link · parent

:ALEHover
123456