HackerTrans
TopNewTrendsCommentsPastAskShowJobs

keithasaurus

417 karmajoined 9 tahun yang lalu

comments

keithasaurus
·19 jam yang lalu·discuss
https://blorp-lang.org

Taking a bit of a detour with self-hosting the language, now that the syntactic surface, standard library, and initial dependency strategy are on a decent footing.

With any luck, by the end of the week, I'll start prepping for a 0.0.1 release.
keithasaurus
·bulan lalu·discuss
The memory management model is automatic reference counting, with some optimizations, such as perseus for compile time reference counting where possible, and copy-on-write at runtime.
keithasaurus
·bulan lalu·discuss
I'm the creator of Blorp -- this made me chuckle a bit. I hadn't even considered that possibility.
keithasaurus
·bulan lalu·discuss
Yes, it's python-inspired. Some notable differences are: - no return keyword - match/if are expressions - it's functional - =? is used for early returns or binding, depending on the variant of an Option or Result that is returned

There's a lot of other differences -- it's a smaller language surface than Python overall.
keithasaurus
·bulan lalu·discuss
Yeah, this is the idea. This chaining is exactly the same as the pipeline operator in some some function languages, except that it hopefully reads in a more familiar way to programmers of non-functional languages.
keithasaurus
·bulan lalu·discuss
Yes, blorp does that. And it also allows local mutation and loops inside pure functions, so performance doesn't need to be left on the table in most cases.
keithasaurus
·bulan lalu·discuss
Hi, maintanier of blorp here. I think you mean that [1,2,3].map(func(x): x *2).filter(func(x): x > 5) would iterate twice, correct? Under the hood blorp optimizes that away for the functions we can. It constructs a loop and combines logic into a single iteration where possible.

Of course, blorp also allows local mutation in loops (even in pure functions, so long as the logic is contained to the function), so if there's a specific algorithm you'd rather express in a loop, you can.
keithasaurus
·bulan lalu·discuss
Hey - I'm the creator of Blorp, and like a lot of the ideas you have in Roc! Did you consider having opt-in purity? Or some other means of conveying impurity other than "!"?
keithasaurus
·bulan lalu·discuss
It's called blorp because it's the name of a stegosaurus my kids and I made up.
keithasaurus
·bulan lalu·discuss
Hey... I'm the maintainer and had no idea this was posted. The reason pure is required is because it's clear and opt-in. There's a CLI subcommand called purify that will help identify pure functions that haven't been deemed so if that's desired.

But there can be many (small) applications where pure doesn't even matter, so I don't really want to force someone to write "impure" for the main function, for example.
keithasaurus
·bulan lalu·discuss
Still incomplete there. But yeah performance should be decent. Not aiming for parity either rust or go entirely but in the same ball park is the expectation.
keithasaurus
·bulan lalu·discuss
Yeah, no shared mutable memory; coordination is done via channels.
keithasaurus
·bulan lalu·discuss
How is compiling to zig? I considered doing it but chose C instead because of how much zig is still changing. I've considered using it's C compiler for targeting multiple platforms locally.
keithasaurus
·bulan lalu·discuss
No, blorp doesn't use affine types (one or zero uses). In blorp, ownership is not explicitly controlled by users at all, so it's opaque. Under the hood, it's perceus for compile-time ownership and borrowing and automatic reference counting with copy-on-write optimizations for the runtime. This is made reasonably easy for the compiler to reason about in blorp because semantically it doesn't _really_ have in-place mutation -- `var` really means "re-bindable" to a new value; and then under the hood we'll mutate in place where we can.
keithasaurus
·bulan lalu·discuss
I have some similar goals. Have you considered leaning more into inference than gradual typing? One pattern I like is allowing the compiler to develop a more complex mental model, but keeping it straightforward for users -- you can do that with inference, ownership, purity, effect types, etc. What I actually think is really tantalizing is using tooling to fill in some of those gaps -- for instance, the editor could know types, required capabilities etc, without the user ever needing to type anything, but when the user needs it, they can find it, query it, test against it.
keithasaurus
·bulan lalu·discuss
Yeah, concurrency in blorp doesn't allow shared mutable references, so deadlocks aren't really a concern. Otherwise it's meant to be simple-ish -- virtual threads, channels, no async/await. Pure functions allow safe parallelism naturally, so that's fairly straightforward, though the API is still incomplete, for example the "Parallel" section here: https://blorp-lang.org/docs/lists/. It's still under heavy development (working on it right now).

What are the over-arching goals of your language?
keithasaurus
·bulan lalu·discuss
Working on something kinda similar. No GC, Python feel, managed memory, performance approaching C. It's here: https://blorp-lang.org if you want to compare approaches.
keithasaurus
·10 bulan yang lalu·discuss
It's not the core of koda-validate, and yeah lots of libraries have a similar capacity. Feedback I'd be interested in is if there are gaps.

In general the value prop of koda-validate is that it turns validation into typesafe building blocks, which makes validators very re-usable -- and flexible. Some other notable differences from pydantic are that it doesn't `raise` on validation errors, you don't need a typing plugin, and it's fully asyncio-compatible.
keithasaurus
·10 bulan yang lalu·discuss
Updating my validation library for python, koda-validate (https://github.com/keithasaurus/koda-validate).

Focusing on ergonomics improvements. Just released an improvement to the __repr__ for Invalid types.

Potentially working on expanding the ability to generate validators from arbitrary typehints, ie `get_typehint_validator(list[str | int])`. It has good coverage, but I suspect I'm blind to some obvious holes. Would love feedback!
keithasaurus
·10 bulan yang lalu·discuss
could java please also learn that stand-alone functions are cleaner than static methods? even if it's just syntax sugar...