News for hackers. Stuff that matters.
Re:Mirth – a type-safe concatenative purely functional progr... by hombre_fatal on Friday July 12, 2019 @02:23PM (#20423058)
I was interested by the title, but it really needs a quick-start + examples in the readme.
Re:Mirth – a type-safe concatenative purely functional progr... by ssalka on Friday July 12, 2019 @03:06PM (#20423449)
Came here to say this. Majority of engineers will bounce immediately once they see there is no code snippets in the README, nor an examples folder.
Re:Mirth – a type-safe concatenative purely functional progr... by tomsmeding on Friday July 12, 2019 @03:50PM (#20423849)
To be frank, the src/ folder is the compiler for Mirth written in Mirth, so there's your example code. However, I do agree that a quick introduction would not be out of place.
Re:Mirth – a type-safe concatenative purely functional progr... by paulddraper on Friday July 12, 2019 @04:42PM (#20424321)
But the first thing I want to about C is not a compiler written in C. That's an unfriendly intro to almost any language.

I want to see a procedure call, "Hello world" I/O, some math or string manipulation, and how to run that myself.

After that I can look at compiler sources.

Re:Mirth – a type-safe concatenative purely functional progr... by edejong on Friday July 12, 2019 @05:57PM (#20424888)
LISP is a notable exception. Btw, I do believe a compiler should be one of the examples of a new language.
Re:Mirth – a type-safe concatenative purely functional progr... by bogdanoff_2 on Friday July 12, 2019 @10:58PM (#20426237)
Are you saying that lisps are an exception to needing to see some small examples at first when looking at a new language? Why do you think they're an exception?
Re:Mirth – a type-safe concatenative purely functional progr... by edejong on Saturday July 13, 2019 @06:55AM (#20427463)
In LISP-like languages a compiler/interpeter is a simple example.
Re:Mirth – a type-safe concatenative purely functional progr... by kazinator on Sunday July 14, 2019 @12:28AM (#20431637)
https://github.com/sbcl/sbcl/tree/master/src/compiler

Doesn't look simple to me.

This one is in one file, but more than half a megabyte of code spanning close to 12000 lines:

https://github.com/clisp-lang/clisp/blob/master/src/compiler...

The Emacs Lisp byte compiler also doesn't look like a good small example for neophytes:

http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/emacs-l...

Re:Mirth – a type-safe concatenative purely functional progr... by garmaine on Friday July 12, 2019 @06:59PM (#20425287)
FWIW, concatinative languages are even simpler than Lisp.
Re:Mirth – a type-safe concatenative purely functional progr... by garmaine on Friday July 12, 2019 @04:23PM (#20424150)
True, and that would be a good thing for the README to emphasize. It's mentioned, but in passing.

But even so, I know I'd like a good reference of what primitive operations are, the type system, and what's provided by the Prelude.

Re:Mirth – a type-safe concatenative purely functional progr... by 0815test on Saturday July 13, 2019 @01:44AM (#20426680)
I've looked at some basic library code that is implemented as part of the compiler, and... well, I'm not sure about this. The syntax does not really seem reminiscent of concatenative languages ala FORTH, so in what sense is this a "concatenative" language? The documentation doesn't say - there is no documentation to speak of. I'm not going to dismiss the effort that has been put into this already, but I'd sure like to see some more overall polish applied - then it could even be reposted to HN, and perhaps garner far more useful critiques.
Re:Mirth – a type-safe concatenative purely functional progr... by garmaine on Saturday July 13, 2019 @10:43AM (#20428270)
Are we looking at the same thing? It’s definitely a post-fix stack based language. It just also has strong ML-like types.
Re:Mirth – a type-safe concatenative purely functional progr... by wjsetzer on Friday July 12, 2019 @03:43PM (#20423775)
I think even beyond that, I didn't see a link to any docs in the readme. It may be cool, but I can't use it if there's nothing to tell me how.
Re:Mirth – a type-safe concatenative purely functional progr... by detaro on Friday July 12, 2019 @02:24PM (#20423067)
I found some more information in posts on the patreon page, but not a good intro.
Re:Mirth – a type-safe concatenative purely functional progr... by agentofuser on Friday July 12, 2019 @05:09PM (#20424538)
Re:Mirth – a type-safe concatenative purely functional progr... by nudpiedo on Friday July 12, 2019 @07:54PM (#20425577)
I have no idea how to read or make sense of these definitions. I mean semantically and grammatically. What should I read if I want to understand those snippets and how/why they do define what an addition is?
Re:Mirth – a type-safe concatenative purely functional progr... by dan-robertson on Saturday July 13, 2019 @09:48AM (#20428038)
The first confusing thing is the type signatures. Concatenative languages pass everything around with a stack so here the double dash separates a top part of the stack before application from what the application of the word transforms that bit of the stack into, so:

  succ : Nat -- Nat
means that if you can prove there is a Nat, n on the top of the stack, you can do succ to replace that with a Nat, succ n. Similarly we have:

  + : Nat Nat -- Nat
Which says if you have two Nats on the top of the stack you can do + to get a single Nat.

The next weird thing is pattern matching. + is defined with two cases. The first is:

  zero + = id
Which makes some sense: to add zero to x, do nothing. Making up a variable syntax it would look like:

  <x> zero + = <x>
The pattern matching on the next line is harder:

  succ + = + succ
Which (making up syntax again) says that if your stack looks like:

  m n
And n = succ k:

  m (succ k)
And you do +, you “unapply” succ to get a “stack” that looks like:

  m k succ
With the application of + shown:

  m k succ +
And this matches the pattern above so we transform:

  m k + succ
And evaluate:

  (m+k) succ
  (m+k+1)
  (m+n)
I think this is a rough idea of how the basic types work:

  Denote a “stack” of types (e.g. Nat Nat above) as [a], and single types a.
  If e : [a] -- [b] then for any [c], e : [c] [a] -- [c] [b]
  If dashes are omitted from a type a, it is the same as the type -- a (ie [b] -- [b] a for any [b])
  If e : [a] -- [b] and f : [b] -- [c] then e f : [a] -- [c]

  To define a word w : [a] -- [b], e w = f is a valid clause if:
  1. e has type [c] -- [a]
  2. f has type [c] -- [b]
  3. e is a valid pattern (ie made out of constructors (?))
I guess the rest of the typing rules are more complicated.
Re:Mirth – a type-safe concatenative purely functional progr... by Smaug123 on Saturday July 13, 2019 @02:48AM (#20426855)
The syntax is a bit peculiar, but they defined the union type Nat, defined the function + which takes two Nats and returns a Nat (which they defined in a thoroughly confusing point-free way because the language is concatenative), and demonstrated the associativity of +.

If you read any introduction to dependent types, they will do this.

Re:Mirth – a type-safe concatenative purely functional progr... by nudpiedo on Saturday July 13, 2019 @05:23AM (#20427249)
Ok, now I get it... I was just lost in the syntax.
Re:Mirth – a type-safe concatenative purely functional progr... by hashmal on Friday July 12, 2019 @04:44PM (#20424328)
It's unbelievable how many languages are introduced without an example on the homepage. Imagine an Apple homepage without any iPhone pictures.
Re:Mirth – a type-safe concatenative purely functional progr... by agentofuser on Friday July 12, 2019 @05:02PM (#20424463)
It's unbelievable how entitled people can be towards things that are published for free by authors who owe them nothing.

Mirth hasn't been released. I found it and decided to share it.

Re:Mirth – a type-safe concatenative purely functional progr... by dmitriid on Friday July 12, 2019 @05:09PM (#20424542)
> Mirth hasn't been released. I found it and decided to share it.

So you are actually doing it a disservice. Perhaps the author intended a larger release with better docs and examples (or no release at all if it’s a toy project).

But now it will be yet another “ah, one of those languages with no documentation or viable use cases”.

Languages are a dime a dozen, there are several of then on HN each weak. “How dare you demand something from something made for free” is not a credible defence for anything.

Re:Mirth – a type-safe concatenative purely functional progr... by tluyben2 on Friday July 12, 2019 @10:43PM (#20426202)
A Forth-y with types, let alone dependent types, are not ‘a dime a dozen’.
Re:Mirth – a type-safe concatenative purely functional progr... by olodus on Friday July 12, 2019 @02:24PM (#20423072)
Oh wow, cool. Have been hoping for another concaternative functional language. It really feels like one of those underrepresented language types. Always hoped to create something in Kitten but never got around to it and the development was mostly dead last time I looked at it. The way these languages both keeps all the simplicity of a lisp and the strong abstractions of modern functional languages, while still feeling and being close to the metal in a way most func langs never can is something I feel should be better explored. Though I don't see any example code on the README... Seems quite early so it's understandable, but would love to see more about it.
Re:Mirth – a type-safe concatenative purely functional progr... by ofrzeta on Friday July 12, 2019 @02:29PM (#20423110)
> Always hoped to create something in Kitten but never got around to it and the development was mostly dead last time I looked at it.

You can still use Factor http://factorcode.org/

Re:Mirth – a type-safe concatenative purely functional progr... by 6thaccount2 on Friday July 12, 2019 @02:59PM (#20423372)
The creator of Factor left years ago to work on Swift I think.

I think it is still maintained, but slow releases.

Re:Mirth – a type-safe concatenative purely functional progr... by gre on Friday July 12, 2019 @03:14PM (#20423528)
The "Development release" of Factor is the best version to use. I'll see about releasing point versions more often.
Re:Mirth – a type-safe concatenative purely functional progr... by 6thaccount2 on Friday July 12, 2019 @04:42PM (#20424317)
Thanks! I only looked at it a little awhile back, but thought it was really cool...as a newbie I need more of an intro text to leverage it.
Re:Mirth – a type-safe concatenative purely functional progr... by 32bitkid on Friday July 12, 2019 @02:36PM (#20423176)
I thought for a second this was a post on Mirth Connect and I had flashbacks to doing hl7 integrations.

https://en.m.wikipedia.org/wiki/Mirth_Connect

Re:Mirth – a type-safe concatenative purely functional progr... by yellowapple on Friday July 12, 2019 @03:37PM (#20423721)
Well now it's called NextGen Connect™, so I guess there's no more naming conflict :)
Re:Mirth – a type-safe concatenative purely functional progr... by taborj on Friday July 12, 2019 @04:20PM (#20424124)
Yeah, but everyone in the industry still calls it Mirth.

Personally, I'm a Qvera man myself, but there's a cost to entry there (unless their free Standard edition does what you need).

Re:Mirth – a type-safe concatenative purely functional progr... by dokka on Friday July 12, 2019 @04:07PM (#20424006)
Hah! So did I! I'm working on Mirth Connect right now.
Re:Mirth – a type-safe concatenative purely functional progr... by athenot on Friday July 12, 2019 @03:40PM (#20423744)
Same here. For a second I wondered if they had produced a new language. :)
Re:Mirth – a type-safe concatenative purely functional progr... by molteanu on Saturday July 13, 2019 @01:56AM (#20426711)
But, but...when do you get to actually use all these awesome languages?

> Forth, Haskell, Idris, Rust, Lisp.

All great. I would do anything to find a shop that actually uses any one of these instead of the usual boring stuff.

Seriously, how would one proceed to find such places?

Re:Mirth – a type-safe concatenative purely functional progr... by Smaug123 on Saturday July 13, 2019 @02:49AM (#20426858)
A number of places use Haskell. There's a list at https://wiki.haskell.org/Haskell_in_industry.
Re:Mirth – a type-safe concatenative purely functional progr... by floatboth on Saturday July 13, 2019 @05:12AM (#20427221)
Academic research :)

And personal FOSS projects of course.

Re:Mirth – a type-safe concatenative purely functional progr... by fastball on Saturday July 13, 2019 @02:08AM (#20426738)
1. Pick one of those langs.

2. Build a product.

3. ???

4. Profit.

Re:Mirth – a type-safe concatenative purely functional progr... by molteanu on Saturday July 13, 2019 @02:12AM (#20426746)
1. Done

2. Done

3. ???

4. It's open source (damn it!)

Re:Mirth – a type-safe concatenative purely functional progr... by fastball on Saturday July 13, 2019 @11:40AM (#20428564)
Well next time make something that you can turn into a viable business and build an org around that lang and that culture.

Be the change you want to see!

Re:Mirth – a type-safe concatenative purely functional progr... by kfk on Saturday July 13, 2019 @02:43AM (#20426849)
Very random question. It’s the first I come across a concatenative programming language. Is SQL also concatenative in a way? I am thinking what you can do by chaining subqueries together for instance using “WITH”.
Re:Mirth – a type-safe concatenative purely functional progr... by 0815test on Saturday July 13, 2019 @03:03AM (#20426902)
Not at all. "Concatenative"[1] is a property of a language syntax; broadly speaking, it holds that an arbitrary expression in the program text can be understood as a sequence of words, and any subsequence is in some sense meaningful; that is, the semantics of the expression as a whole is derived by "concatenating" the semantics of each word, and this semantic "concatenation" is consistent in that it can be used to provide a semantics to any subsequence.

[1] https://en.wikipedia.org/wiki/Concatenative_programming_lang...

This all works well for untyped languages (FORTH is untyped, as an example), but once you add in reasonably complex types you can't really use "sequences" alone, anymore; the directly comparable property is instead true of string diagrams. And once you add some more complexity, you even have to deal with, e.g. proof nets. There are ways to simplify textual syntaxes like e.g. typed lambda calculus along 'concatenative' lines, but mostly these are simple tweaks (De Bruijn notation, and/or De Bruijn indexes) that don't really create a "different" language.

Re:Mirth – a type-safe concatenative purely functional progr... by zaiste on Saturday July 13, 2019 @08:13AM (#20427670)
Would you be willing to point me to some research/articles related to your statement about complex types? I'm (also) working on a statically-typed, concatenative programming language. It's for fun. I'd like to learn more about this topic.
Re:Mirth – a type-safe concatenative purely functional progr... by 0815test on Saturday July 13, 2019 @09:59AM (#20428075)
See https://arxiv.org/abs/0903.0340 for a basic introduction to the issues, and https://arxiv.org/abs/0908.3347 for a slightly more extensive treatment, also mentioning proof nets. This does not explicitly say that these diagrams can be understood as the equivalent to sequences in something FORTH-like, but this is in fact what the papers are pointing out in a general sense, so I see it as a rather trivial remark.
Re:Mirth – a type-safe concatenative purely functional progr... by zaiste on Saturday July 13, 2019 @11:16AM (#20428440)
Thank you!
Re:Mirth – a type-safe concatenative purely functional progr... by pmarreck on Saturday July 13, 2019 @12:30PM (#20428830)
FORTH was (I think?) one of the first concatenative languages, if not the first.

Interestingly, PostScript is also concatenative.

If you've ever used an RPN calculator, you almost understand how concatenative languages work!

Re:Mirth – a type-safe concatenative purely functional progr... by dmix on Friday July 12, 2019 @05:13PM (#20424571)
I love the syntax.

Does anyone know how Github chooses which languages to adopt in their language detector?

Re:Mirth – a type-safe concatenative purely functional progr... by Klathmon on Friday July 12, 2019 @07:51PM (#20425551)
Re:Mirth – a type-safe concatenative purely functional progr... by softwarelimits on Saturday July 13, 2019 @05:03AM (#20427193)
This will change everything!
Re:Mirth – a type-safe concatenative purely functional progr... by edem on Friday July 12, 2019 @02:18PM (#20423025)
Why do we need yet another language instead of improving the existing ones?
Re:Mirth – a type-safe concatenative purely functional progr... by hombre_fatal on Friday July 12, 2019 @02:31PM (#20423128)
Your profile says you like tinkering, yet you don't understand why others would tinker and experiment with new things?

Do you only give yourself a pass for tinkering instead of using your precious free-time to credentialize in and improve existing software?

Re:Mirth – a type-safe concatenative purely functional progr... by tunesmith on Friday July 12, 2019 @03:02PM (#20423404)
Man, I don't know if it's against site guidelines, but I've never liked using people's bios - even if public on HN - as ammunition against their comments. Isn't it better to just respond to the content of the comments themselves?
Re:Mirth – a type-safe concatenative purely functional progr... by rickbutton on Friday July 12, 2019 @04:04PM (#20423986)
There is always a person or two at the bottom of every thread like this that loves to spew hate towards people that like to share interesting side-projects, usually in a "you are wasting your time because your project has no immediate value to ME, go spend it serving my interests instead" sort of way. Claiming to also be a tinkerer in your public bio on the same website is gross, and IMO fair game to point it out.
Re:Mirth – a type-safe concatenative purely functional progr... by DoreenMichele on Saturday July 13, 2019 @12:37PM (#20428859)
IIRC, site guidelines don't specifically say "no ad hominems," but it seems to be generally understood that "no ad hominems" is the correct interpretation of this guideline:

When disagreeing, please reply to the argument instead of calling names. "That is idiotic; 1 + 1 is 2, not 3" can be shortened to "1 + 1 is 2, not 3."

https://news.ycombinator.com/newsguidelines.html

Re:Mirth – a type-safe concatenative purely functional progr... by garmaine on Friday July 12, 2019 @03:57PM (#20423914)
Trying to start from common ground isn’t “ammunition” imho.

Although it depends on how it is phrased of course.

Re:Mirth – a type-safe concatenative purely functional progr... by pmarreck on Saturday July 13, 2019 @12:32PM (#20428837)
> I've never liked using people's bios - even if public on HN - as ammunition against their comments

I'm inclined to agree, but in the case of outright hypocrisy I think the point deserves to be made, because hypocrisy is literally the worst

Re:Mirth – a type-safe concatenative purely functional progr... by edem on Monday July 15, 2019 @07:13AM (#20439680)
I like tinkering but I don't add to the mess by open sourcing yet another language.
Re:Mirth – a type-safe concatenative purely functional progr... by dang on Friday July 12, 2019 @07:23PM (#20425407)
"Please don't post shallow dismissals, especially of other people's work."

https://news.ycombinator.com/newsguidelines.html

Re:Mirth – a type-safe concatenative purely functional progr... by justfordang on Friday July 12, 2019 @10:13PM (#20426098)
I know you are a gigantic egomaniac and I'm wasting my time writing this, but if you could ever repress your inflated sense of (mis)justice for two seconds, you might notice that the poster actually asked a perfectly valid question.

With the context presented so far (zero, for those keeping score at home), there's no reason to assume that the poster is dismissive of the project being discussed.

Why IS Mirth needed, when we can improve other languages? This is actually a perfect segue for proponents of Mirth to explain the niche the language occupies and it's pros and cons for users/engineers.

Thanks for making HN cancer, dang. Honestly, you're jumping up random asses on the internet that you'll never meet nor matter to is why the quality of discussion on HN has reached the trough it seems comfortably rested in. But hey. You posted the guidelines. You're a hero.

Re:Mirth – a type-safe concatenative purely functional progr... by coldtea on Saturday July 13, 2019 @07:16AM (#20427513)
>I know you are a gigantic egomaniac and I'm wasting my time writing this, but if you could ever repress your inflated sense of (mis)justice for two seconds, you might notice that the poster actually asked a perfectly valid question.

Also a perfectly trivial one, an insulting one, and one that has been asked countless times, and that has no real place in a post presenting a new language but goes to meta yak shaving philosophy.

(A question like "what are Mirths differentiating points, what new does it bring" would be an acceptable version -- but that wasn't what was asked).

Note that by starting with "I know you are a gigantic egomaniac" and "inflated sense" and "Thanks for making HN cancer", you already show that you don't have a valid contribution to the discussion either. It even seems like the content of the discussion was secondary, just needed to vent at someone...

Re:Mirth – a type-safe concatenative purely functional progr... by 0_gravitas on Saturday July 13, 2019 @09:39AM (#20427985)
Seeing as his account is 11 hours old as of my writing this and that this is his only comment I have a little paranoid-detective feeling that this may be from PC, just an alt account, even if not they are clearly a very angry person
Re:Mirth – a type-safe concatenative purely functional progr... by dang on Saturday July 13, 2019 @01:45PM (#20429216)
Not as far as I can tell. There are users whose emotions have taken this form for whatever reason, and they show up like superheroes in arbitrary scenes.

That comment was killed automatically by HN's anti-troll software, but I unkilled it last night. Maybe that was a mistake since it led to more offtopicness.

Re:Mirth – a type-safe concatenative purely functional progr... by openfuture on Saturday July 13, 2019 @05:27AM (#20427261)
Wow.. and you don't feel like the comment you made is contributing to the problem?

If you want to live in a society where respect trickles up instead of violence trickling down then you mustn't express yourself with violence.

Re:Mirth – a type-safe concatenative purely functional progr... by Buge on Saturday July 13, 2019 @04:32AM (#20427119)
Insults like this are very annoying to read. If you think the moderation is too strict and is hurting HN's environment, then say that. There's no need to be so mean about it.
Re:Mirth – a type-safe concatenative purely functional progr... by staticassertion on Friday July 12, 2019 @05:09PM (#20424544)
I think that history has taught us that the best way to get existing languages to improve is to demonstrate the value of a paradigm or feature out-of-band in some other language, possibly a new one.
Re:Mirth – a type-safe concatenative purely functional progr... by edem on Monday July 15, 2019 @07:14AM (#20439685)
I see your point. This is what happens now with Java.
Re:Mirth – a type-safe concatenative purely functional progr... by wool_gather on Friday July 12, 2019 @02:53PM (#20423327)
You could look at it as a POC: ideas from experimental or niche languages sometimes find their ways into existing mainstream languages.
Re:Mirth – a type-safe concatenative purely functional progr... by willtim on Friday July 12, 2019 @03:37PM (#20423722)
What language are you going to try and improve? Add static types to Python? Or make Java purely functional? Often one needs to start again. Mirth looks much better than most.
Re:Mirth – a type-safe concatenative purely functional progr... by ithkuil on Friday July 12, 2019 @04:32PM (#20424233)
There exist other languages in the category, e.g. https://kittenlang.org/, http://www.factorcode.org/, https://github.com/cdiggins/cat-language, https://en.m.wikipedia.org/wiki/Joy_(programming_language). I assume the parent poster referred to improving those (or at least explaining which deficiencies of those myrth is addressing).

(In case you didn't already, you can read about this family of languages in http://evincarofautumn.blogspot.com/2012/02/why-concatenativ...)

I'm personally happy that somebody is doing more research in this field.

Re:Mirth – a type-safe concatenative purely functional progr... by voxl on Friday July 12, 2019 @05:28PM (#20424678)
Note that none of these languages have dependent types and that feature is sometimes impossible to add in full generic power after the fact without completely breaking existing code.
Re:Mirth – a type-safe concatenative purely functional progr... by ithkuil on Saturday July 13, 2019 @09:47AM (#20428026)
I think there is some misunderstood. I just saw mentions of java and python and I just wanted to add some pointers for people who might not know that myrth lives in a void. I didn't want to imply that there is no point in writing a new language.
Re:Mirth – a type-safe concatenative purely functional progr... by garmaine on Friday July 12, 2019 @09:45PM (#20426007)
Does mirth? I've been perusing the code and haven't seen anything like that so far.
Re:Mirth – a type-safe concatenative purely functional progr... by garmaine on Friday July 12, 2019 @09:45PM (#20426009)
Unrelated, do you speak Ithkuil?
Re:Mirth – a type-safe concatenative purely functional progr... by tluyben2 on Friday July 12, 2019 @10:37PM (#20426178)
I am only recently aware of Patreon because of that V-lang stuff that has been hyping around on Reddit and here; this however seems very interesting to me. In my spare time I have been working on something similar for a long time but this looks, at first glance, clean and well done compared to my own efforts. Will have a play when I really wake up.

Another nice one (again imho) is [0].

[0] https://www.patreon.com/csaba_hruska