Shop OBEX P1 Docs P2 Docs Learn Events
Juniper programming language — Parallax Forums

Juniper programming language

I recently came across Juniper, A Functional Reactive Programming Language for Arduino. I find the idea behind the language intriguing, and can't help but wonder if it (or something like it) would be really well suited for the P2. Has anyone else seen or used this language?

Comments

  • cgraceycgracey Posts: 14,133
    edited 2016-06-07 20:40
    I just looked at the tutorial, briefly. It looks like it takes a lot of monkey motion to do something. I bet the core concept could be implemented with way less cruft. I need to look at it more to realize what the core concept even is. There's a lot of pointy text in the way.
  • jmgjmg Posts: 15,144
    Seairth wrote: »
    I recently came across Juniper, A Functional Reactive Programming Language for Arduino. I find the idea behind the language intriguing, and can't help but wonder if it (or something like it) would be really well suited for the P2. Has anyone else seen or used this language?

    Last time I looked at functional programming, it was a look at Haskell....
    https://wiki.haskell.org/Why_Haskell_matters

    Not sure about a very-niche language applied to a niche part... ?
    I think P2 needs mainstream languages.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2016-06-07 21:39
    I think the P2 needs at least one mainstream language and at least one "fun" -- easy, yet full-featured -- language. I'm not sure where Juniper fits in here, as I tend to agree with Chip that there are a lot of brambles blocking the gate. (But I'm a Perl programmer, so take that for what you think it's worth. :) )

    -Phil
  • That's the most complicated LED blinker I've ever seen. All of the examples in the examples directory on their github are similarly overcomplicated. Why would anyone use Juniper?
  • Yes, it is very rough around the edges (and the the middle). It is, after all, the output of a senior thesis project. I probably overstated things a bit when I suggested that it would be "really well suited for the P2".
  • Heater.Heater. Posts: 21,230
    Most people have a really hard time getting into functional programming.

    For a start in a pure functional language a function can only take parameters in, calculate some result, and return it. It should do that exact same thing whenever it is called with the same parameters.

    So a function can have no side effects, like printing something or changing a LED state. It can have no internal state that might cause it to return different values when called with the same parameters. You can't write a pure functional timeNow() function.

    Then all variables are immutable. Once they have been assigned a value you can never change that value. If you want a new value you need a different name for it.

    All of this has very sound logic behind it in terms of reasoning about how your program works. But heck it's hard to work with.

    I don't know about Juniper but often "functional" programming languages bend the rules a bit so that people can actually get stuff done. Like I/O !

    Of course, "functional programming" is a style of program design that you can do in almost any language.

    Why anyone would want this in little programs on the little Arduino I have no idea.








Sign In or Register to comment.