Functional Programming in hica

(hica.dev)

52 points | by cladamski79 6 days ago ago

20 comments

  • cladamski79 6 days ago ago

    hica is a functional, expression-based programming language, everything is an expression and immutable by default. Its goal is to make programming very approachable for beginners (and veterans alike). You learn by doing small programs, then dive deeper on a thing you really want to build.

    This is a guide on functional programming which covers immutability, higher-order functions, pipelines, and more, all with runnable examples.

    If that is to theoretical there is https://www.hica.dev/docs/hica-for-beginners/ that walks through functions, pattern matching, and lists by building real programs.

    Happy to answer questions about the design decisions, the implementation or how to get started.

  • blanched 3 days ago ago

    Quick fyi that your website is “zoomed in” on mobile safari and a little difficult to use

    (Apologies if it’s just my device)

    I’ll take a closer look on my desktop later today, I love seeing new programming languages. Sounds interesting!

    • cladamski79 2 days ago ago

      I took a look and added -webkit-text-size-adjust to please Safari, hope it helps. And thanks!

      • twhitmore 2 days ago ago

        Grid layout error in your CSS/ HTML, I think.

        You've assigned `grid-area: main` to the content but the parent grid doesn’t define "main" in its grid-template-areas; the browser creates an implicit grid row/column to satisfy the placement, and this ends up being below the defined areas. Thus requiring 1 page blank space to scroll down.

        You can investigate the `<div class="main-content">` in Dev Tools by toggling the 'grid-area' CSS attribute off; that fixes the display.

    • tgv 3 days ago ago

      Same here. Needs one of those "standard" html headers, I think.

      • lioeters 3 days ago ago

        Hm, I checked the site and it does have one of these:

          <meta name="viewport" content="width=device-width, initial-scale=1.0">
        
        Which is the standard. I wonder if something else is interfering with it.
  • nyankosensei 3 days ago ago

    Thanks for sharing. Very interesting, especially since it’s based on Koka, which I’ve been experimenting with and still trying to wrap my head around. It also reminds me a lot of Shen (https://shenlanguage.org/). I’ll definitely try this out.

    How do you pronounce the name?

    • cladamski79 2 days ago ago

      I created a backronym of a longwinded name and I pronounce it as hi-ca, or perhaps hee-ca :)

      Shen is very interesting, I actually created a lisp in hica as a learning exercise, check it out at https://github.com/cladam/hica-lisp

  • esafak 3 days ago ago

    Looks good. If it is not too early to ask, how fast are compile times and executables, and informative are the error messages?

  • mogoh 3 days ago ago

    Does this aims to be the python of functional programming languages?

    • cladamski79 2 days ago ago

      That's roughly the positioning, yes. Approachable syntax, low ceremony, runs scripts directly. The difference is that the safety guarantees (no null, tracked effects, exhaustive matching) come for free rather than being opt-in via type checkers.

      I did a comparison to python which shows the differences, and where they are similar: https://www.hica.dev/docs/hica-vs-python/

  • jdw64 3 days ago ago

    It feels like C#, so it seems easy to learn. Looks fun.

  • xixixao 2 days ago ago

    Looks very tasteful! Good job!