Hi there, I'm Tau. 👋
I'm currently in a very deep rabbit hole trying to bring automatic dark/light detection to terminals and applications running inside terminals.
Some very rough notes can be found in my agenda repository.
WIP lambda calculus parser and evaluator with a very professional name
Hi there, I'm Tau. 👋
I'm currently in a very deep rabbit hole trying to bring automatic dark/light detection to terminals and applications running inside terminals.
Some very rough notes can be found in my agenda repository.
λa b f x . a (b f) x
can be simplified to λa b f . a (b f)
If a normal form exists, annotate it with a list of nominal definitions it matches.
E.g. for the following term:
True -> (&t f . t)
False -> (&t f . f)
0 --> (&f x. x)
(False)
The normal form should be shown as:
->> (λ(λ1))
^^^^^^^
Also known as False, 0.
This would be helpful for testing that a building block indeed does what it's supposed to.
A special built-in definition should do the trick:
assert (EXPECTED_TERM) (ACTUAL_TERM)
Or a dedicated syntax maybe?
Syntax is very similar to schematic definitions
True -> (λt f.t)
False -> (λt f.f)
Definitions may reference other definitions but they may not be
mutually recursive to prevent infinite loops while expanding definitions.
(You should use a Y-combinator if you need mutual recursion)
The reducer using namefree expressions was very easy to implement (and educational ^^). However it comes with a few drawbacks concerning debuggability:
My new goal is to implement a reducer for expressions with names, which means I need to implement ɑ-Conversion after all :/
The reducer should expand definitions lazily i.e. when a definition is on the left side of the outermost application.
Ideally the renaming of the ɑ-Conversion is also done in a separate step for a better user experience.
warning: unnecessary abstraction
┌─ tests/factorial.lc:7:7
│
5 │ (λ decr
6 │ .
7 │ (λ self . self self)
│ ^^^^ ^^^^ help: remove the abstraction and this application
8 │ (λ self n . n (λ_ . mult n ((self self) (decr n))) 1)
9 │ )
API shape that I have in mind:
pub fn reduce_to_normal_form(
expression: Expression<'_>,
max_reductions: u64,
) -> impl Iterator<Item = DiagnosticsResult<Expression<'_>>>;
I'm not sure what the best return type would be, but I think having the iterator is a good idea
because it allows my UI to display all steps and then an diagnostics message if we do to many reductions.
The diagnostic message should point to the application that was last applied.
Returning a diagnostic depends on #7.
Haskell is pretty liberal with the allowed operator symbols, that sounds nice:
https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-160002.2
Unicode categories:
https://www.unicode.org/reports/tr41/tr41-30.html#Unicode
The AST should be as close to the entered syntax as possible. This makes warnings / suggestions much more powerful.
Some differences:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.