Giter Site home page Giter Site logo

c-bj / husky Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xiyuzhai-husky-lang/husky

0.0 0.0 0.0 68.31 MB

The Husky Programming Language

License: MIT License

Shell 0.08% JavaScript 0.01% Python 0.36% Rust 95.79% TypeScript 0.98% CSS 0.38% Makefile 0.14% HTML 0.17% Lean 2.09%

husky's Introduction

Work in Progress

The Husky Programming Language

Make programming great again!

โš ๏ธ this repo is still under heavy construction: documentation is still serious lacking, number of todos are above 900, and rustc warnings are everywhere!

Introduction

Husky is a programming language designed for many difficult tasks which haven't yet been seen as programmable at all. For example, we aims towards using Husky for writing a strongly explainable and efficient classifier for image recognition tasks at any scale. Husky can actually do well in traditional programming domains, but the current focus is on exploring the boundary of programming.

The major advancement is the language frontend. In a long time, Husky will rely on Rust/Zig/C/Cpp for compilation so that we don't need to spend too much time in dealing with IRGen.

For a quick review of core ideas in computer vision, see vision-a programming approach.

Get Started

Prerequisites

Make sure rust toolchains are installed. To install vscode extension, npm is also required currently.

Installation

TODO

Run Examples

TODO

What will probably work is,

git clone https://github.com/ancient-software/husky
cd husky

then in one terminal do

cd gui/gui/husky-tracer-gui-sycamore
trunk serve

in another terminal do

make mnist-compiled

then in browser open localhost:8080.

Motivation

A Bright Future of AI

The core belief is the existence of a strongly explainable program (as explainable as the software we wrote) for a range of AI problems, including computer vision, natural language processing. And Husky is designed to be the language to write that program.

Now "explainability" is important for two reasons:

  • allows people to collaborate
  • allows task specific optimization

In fact, a truly explainable AI can be compared with software developed by humans:

datasets -- tests training -- development inference -- runtime

Designs

Pythonic Syntax

alt text

Powerful yet Safe Semantics

All these are possible:

  • eager procedural, like C/C++/Rust/python
  • eager functional, like OCaml
  • lazy functional, like Haskell but advanced to a higher level for the need of machine learning, gui, etc

No interop is needed! (Interop destroys debugging experience, it's good to avoid)

Everything is Configurable

Husky doesn't make premature assumptions about execution model and memory management.

configurable execution

All these are possible:

  • interpretation
  • compiled to binary
  • jit

memory management

All these are possible:

  • individual alloc/dealloc
  • batch alloc/dealloc for (&'eval)
  • tracing garbage collector
  • automatic refcounting

Trace-Based Debugging System

Debugging should be as easy as writing the code itself!

Usually devs are designed for procedural languages, because functional ones don't seem to need one. However, the programming problems solved by Husky is intrinsically much harder that a dev is needed even all code is pure functional. For example, in computer vision, blablabla. The major time cost of debugging is to find which line is wrong.

generic viewpoint: visualize feature over a subset of datapoints

alt text

specific viewpoint: visualize feature at a fixed datapoint

alt text

visualization can be customed in type definition

TODO

About Development

This project was created by and is currently maintained solo by Xiyu Zhai, a Phd in MIT EECS, whose primary background is actually in pure math and has just programmed intensively for the last two years. So please help, smart people!

It was created as a language to implement certain ideas for efficient image classification, which is hard to do in existing languages. Originally it was written in C++, and had gone through many versions that were influenced heavily by C++. However, the lacking of clean pattern matching (like Rust enum) and memory safety and many other things matching make development hard. Then, a Rust version was created from scratch and despite of the learning curve, the development is quite smooth and the design of language is becoming very similar to Rust. Still, value binding is syntactically similar to that of C++ because of succinctness, whereas semantically safety is still guaranteed, just like in Rust.

Khala Links

Talks

language talks

"Outperforming Imperative with Pure Functional Languages" by Richard Feldman https://www.youtube.com/watch?v=vzfy4EKwG_Y/

Repositories

language repos

Interesting new languages

system-level

Zig https://github.com/ziglang/zig.git/

theorem proving

Lean 4 https://github.com/leanprover/lean4/

Xena Project https://github.com/ImperialCollegeLondon/formalising-mathematics/

Metamath Zero https://github.com/digama0/mm0#metamath-zero/

functional

Roc https://github.com/roc-lang/roc/

computer graphics

Taichi https://github.com/taichi-dev/taichi/

ml frameworks

Google Jax https://github.com/google/jax/

Torch Quantum https://github.com/mit-han-lab/torchquantum/

Zulip

Rust https://rust-lang.zulipchat.com/

Lean https://leanprover.zulipchat.com/

Youtube Channels

programming

Rust https://www.youtube.com/c/RustVideos/

Niko Matsakis https://www.youtube.com/user/nikomatsakis/

Healthy Software Developer https://www.youtube.com/c/JaymeEdwardsMedia/

Jon Gjengset https://www.youtube.com/c/JonGjengset/

ThePrimeagen https://www.youtube.com/c/ThePrimeagen/

huskies

Gone to the Snow Dogs https://www.youtube.com/gttsd/

Maya Husky https://www.youtube.com/c/MayaHusky/

K'eyush The Stunt Dog https://www.youtube.com/c/KeyushTheStuntDog/

Gohan The Husky https://www.youtube.com/c/GohanTheHusky/

Skaya Siberian https://www.youtube.com/c/SkayaSiberian/

Sixty Formula https://www.youtube.com/c/SixtyFormula/

husky's People

Contributors

xinjiang1994 avatar xiyuzhai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.