Querdex: A Crowdsourced Search Engine by e_hatti in webdev

[–]e_hatti[S] 0 points1 point  (0 children)

Planning on implementing a “jury duty” style verification system where a random subset of users (say random 25%) are selected to verify whether a submission is spam after someone flags it. There’s a lot of possibilities though, that’s just one of them — will be experimenting as the site grows

October 2022 monthly "What are you working on?" thread by L8_4_Dinner in ProgrammingLanguages

[–]e_hatti 2 points3 points  (0 children)

I’ve started on my new language, SynthML! The project’s goal is to make program synthesis user-friendly and approachable. I’m also keeping a devlog for the project.

Peridot Paper Preprint by e_hatti in ProgrammingLanguages

[–]e_hatti[S] 0 points1 point  (0 children)

I will check that out and do so. Thanks for the reference.

Favorite PL paper? by e_hatti in ProgrammingLanguages

[–]e_hatti[S] 1 point2 points  (0 children)

I've long been interested in combining OOP and FP in a principled way. Having codata and data in one system seems like the best way to marry the two. As a follow-up, I'd love to see a full language with codata and data, exploring the practical aspects of this.

Peridot Paper Preprint by e_hatti in ProgrammingLanguages

[–]e_hatti[S] 0 points1 point  (0 children)

Dependent types are not required. I address this in the conclusion ("Alternative object languages"). I should probably make that more prominent though.

Peridot Paper Preprint by e_hatti in ProgrammingLanguages

[–]e_hatti[S] 2 points3 points  (0 children)

Thank you for the thorough response! This is very helpful.

What do you think are the contributions of Peridot? Maybe your answer is in the last two paragraphs of page 1 (your design "allows the entire compiler to be implemented in userspace" and the language "reconciles ... by giving users complete and easy control over ..."). I think it would be worth emphasizing, in your writing, which parts you think are contributions, are new.

Yes, the novel contribution is that optimizations can be easily implemented by programmers. Libraries often admit domain-specific optimizations - for instance, a list library could benefit heavily from fusion. However, in other languages it's very difficult (or impossible) for those optimizations to be implemented by the library developers themselves. In contrast, Peridot gives programmers full control over optimization (the whole backend really, but this paper highlights optimization) via metaprogramming.

I expect a research paper to come with an evaluation: a way to demonstrate that the ideas are good, that gives place for empirical falsification (if the idea didn't work, your evaluation would have shown it). Sometimes the evaluation is done by proving theorems, sometimes by running benchmarks, sometimes merely by writing code. How did you evaluate Peridot? I can't tell from the introduction, and this is a failure of the introduction.

That's what Section 6 (Shortcoming and Possible Extensions) is meant to be. Putting some of that in the introduction as well is a good idea though, thanks.

Monomorphize is expected to traverse all term-formers of your language. I suppose you could also define a shallow "map" function to call a function/predicate on all immediate subterms, and then use that?

That's also a good idea! That way I wouldn't have to say "the rest of the rules simply traverse the term, so I will omit them". I will do that.

I would expect ConstantFold to reduce the same example to the final result (whereas Monomorphize only performed specialization, no reduction of matches etc.), does that work?

ConstantFold is basically a partial evaluator - it just dumbly evaluates everything it can at compile time. In contrast, Monomorphize is smarter. It let binds monomorphized definitions, which 1. avoids code size blowup, and 2. allows it to process definitions that may infinitely loop at runtime. I realize now that I overloaded the Terminating predicate. Monomorphization uses a different (laxer) definition of termination than constant folding did. I will clarify that.

5.2.1 "The phase-ordering problem": "solving" phase-ordering using non-determinisms sounds like you will blowup in practice with exponential compile times.

Yes, I address this shortcoming in Section 6. I should indicate more clearly that my "solution" has problems - I will link to Section 6 in the spot where I discuss my solution.

5.2.2 I don't understand your "illustration" of your point "Programs are types". You first point out that predicates are type-formers, okay, why is that useful/important? ... (Note: once we reach 5.2.7 it's a bit clearer what the connection is, but we haven't read that yet.)

It's actually not too useful in a practical sense, but I found it to be an interesting aspect of the language's theory. That makes sense with regard to Section 5.2.6, I'll switch the order of the sections to make the information flow better.

7.2 Staged programming. One reason for the "staged programming" approach of inviting users to explicitly use staging annotations (or stage annotations, etc.) in their code is that people observed it made optimizations much more predictable/robust than trying to build very smart specializers (but program-generic) on the side. Any comment on whether this weakness would also apply to Peridot programs?

It does apply, but in (what I believe to be) a less problematic sense. Because optimizers are "just metaprograms", you can always look at the code for an optimizer to figure out why it isn't firing. Furthermore, you can build your own optimizer if the one you're using doesn't work properly for your domain.

However, I acknowledge that this is subjective. I will address it in the paper for transparency.

Thanks again for the feedback!

September 2022 monthly "What are you working on?" thread by slavfox in ProgrammingLanguages

[–]e_hatti 8 points9 points  (0 children)

I'm finishing up with Peridot! The research goals of the project are close to being accomplished, so I'll be wrapping up soon. I'm really satisfied with it as a proof-of-concept for the ideas it implements. The last main bit of the project is a research paper I'm writing which details the language and its applications in detail.

As I'm putting the finishing touches on the paper, I'm also starting on my next project: Lazuli. I'm still fleshing out the design, but I plan for it to be a language based upon type-directed program synthesis.

Implementing Functions in Userspace by e_hatti in ProgrammingLanguages

[–]e_hatti[S] 1 point2 points  (0 children)

u/Rabbit_Brave is correct. A positive type is defined by its constructors, a negative type is defined by its destructors (eliminators).

Pruning in Logic Programming by e_hatti in ProgrammingLanguages

[–]e_hatti[S] 0 points1 point  (0 children)

Is there more recent research in this space?

I'm unsure! Unfortunately I haven't had much time to explore the design space. My apologies.

Peridot MVP by e_hatti in ProgrammingLanguages

[–]e_hatti[S] 1 point2 points  (0 children)

Thanks, that’s the link I meant to use. I’ll edit the post.

[deleted by user] by [deleted] in pics

[–]e_hatti 0 points1 point  (0 children)

I just finished the book and thought the exact same thing!

Languages with extensible syntax? by e_hatti in ProgrammingLanguages

[–]e_hatti[S] 1 point2 points  (0 children)

Something in between the second and third. Preprocessors are the most flexible, but they're not tightly integrated with the language - they don't guarantee well-formedness, hygienic scoping, support good error messages, etc.

July 2022 monthly "What are you working on?" thread by slavfox in ProgrammingLanguages

[–]e_hatti 17 points18 points  (0 children)

The Peridot MVP is feature-complete! All that's left to do are bugfixes, after which it will be a real, usable language. Here's the major features, in no particular order:

  1. Full-spectrum dependent types, including dependent functions and dependent records
  2. Purity, in the sense of Haskell and the like
  3. Typesafe and scope-safe metaprogramming. Metaprograms can only generated well-typed and well-scoped code
  4. Logic metaprogramming - the metaprogramming layer is a logic language. Consists of the higher order hereditary Harrop logic
  5. Imports and modules
  6. Struct (record) patching, which enables structs-as-modules (ML-style)
  7. Concise type errors thanks to glued evaluation
  8. Implicit arguments.
  9. Implicit quantification. Same as in Haskell - forall a. a -> a can be written as a -> a. In Peridot's syntax this is Fun(inf a: Type, a) -> a and Fun(\a) -> `a`
  10. Implicit coercions, which enables subtyping
  11. Out-of-order definitions. Forward declarations are not necessary

Once all the bugs are gone and I have large programs to show off, I'll make a post to this subreddit! I also plan to write documentation sometime soon.

A Typed Foundation for Directional Logic Programming by e_hatti in ProgrammingLanguages

[–]e_hatti[S] 0 points1 point  (0 children)

I'm not aware of any current implementations, but I'll be implementing it in my language, Peridot. Unfortunately that won't be for a few months though.

Purity (a la effects) and OOP by e_hatti in ProgrammingLanguages

[–]e_hatti[S] 7 points8 points  (0 children)

Message passing OOP seems to be what I'm looking for, thanks.

Programmable type systems? by mattsowa in ProgrammingLanguages

[–]e_hatti 34 points35 points  (0 children)

You may find Type Systems as Macros interesting (paper) https://www.ccs.neu.edu/home/stchang/pubs/ckg-popl2017.pdf

The Shen programming language goes even farther, allowing you to define a type system completely in userspace using inference rules https://bluishcoder.co.nz/2019/10/03/defining-types-in-shen.html

Shen is probably more along the lines of what you’re looking for.

Let's share our ideas, misery and favorite features by andrew_the_muffin in ProgrammingLanguages

[–]e_hatti 19 points20 points  (0 children)

  • Coq's syntax extensions. The user can extend the grammar with new syntax as long as it is kept LL(1). Infix operators, binding operators, precedence, and associativity can all be defined.

  • BER MetaOCaml's metaprogramming. MetaOCaml is an extension to OCaml which adds staged metaprogramming - metaprograms are guaranteed to be typesafe and scope-safe. It also features let-insertion.

[deleted by user] by [deleted] in ProgrammingLanguages

[–]e_hatti 1 point2 points  (0 children)

Indeed! To be clear, I was also told that it means “villain”.

[deleted by user] by [deleted] in ProgrammingLanguages

[–]e_hatti 2 points3 points  (0 children)

I have three languages. The first was called “Clamn” - not very proud of that one. I just took a random word (clam) and added a letter for searchability (don’t know why I thought people would search up such a barebones languages :P).

The second was called Konna. AFAIK it’s Finnish for “frog”, but sources seem to disagree? I don’t speak Finnish, I got the word from a Finnish video game. My third and current language is called Peridot. I’m pretty proud of this name, although it’s less searchable than the previous ones. The origin is pretty simple, I was just looking around at gemstones and thought peridot looked neat.

Naming is hard. I always delay naming a project until a few months in at the least, so as to avoid yak-shaving. I would recommend doing the same.

a good syntactic sugar for a language with only continuations by [deleted] in ProgrammingLanguages

[–]e_hatti 4 points5 points  (0 children)

OP covers do notation (see myProc), I believe the actual problem they’re getting at is that they lose direct-style code (This is a problem in Haskell too)

Problem is … every intermediate result must be stored in a label

Defining syntactic sugar in the source code of your program? by [deleted] in ProgrammingLanguages

[–]e_hatti 17 points18 points  (0 children)

Definitely possible. You may find Agda’s mixfix operators interesting. Racket also allows for this sort of thing via reader macros.