my Japanese-inspired programming language, Haku, is coming along nicely. I try to work on it a little every day, and I have now the drafts for the parser, abstract syntax tree, AST reader and a Scheme emitter, as well as an input source reader that can handle vertical text.

I wonder why anyone would consider using this language. It is hard to write programs in and there are no advantages to using it as it is quite basic. But creating the language is a lot of fun.

@wim_v12e It's great! It's something that even Apple threw out halfway through the project. I'd love to be one of the first users.

@toneji Did Apple have a project like this? I did not know about it.

There are several other Japanese programming languages, I think they are better than mine will be:

プロデル (Produire):

@wim_v12e Do you know the Japanese version of Apple Script? It's gone now, but at the time, it was very dreamy. But it was hard to use. I haven't used the programming in Japanese that you introduced, but I would like to use what you have created first and foremost.

@toneji I didn't know there had been a Japanese AppleScript, it must have been nice.

Thank you for your faith in me! I will keep working on Haku and when it works for simple programs I will let you know.

@wim_v12e Personally I would *very* interested in learning how to program in Haku! Will you also write a programming guide? I hope so! ^_^

@Eidon Thank you very much! Yes I will, of course! But first I have to make it work. I trust that g.etting the basics working will not take too long, a few more weeks maybe. But to make it a useful language would take much longer, for example adding networking support. Also, at the moment I am emitting Scheme so to use Haku you will need to install both Raku and one Scheme or another. I use Racket.

@wim_v12e I will gladly install Raku (and try to learn it also!)
...If you don't mind, when the time comes, I will ask your help in the aspects that are most obscure to me (I don't know Scheme, what "emitting Scheme" means, and what is Racket. I feel I'm truly ignorant tbh 😭)
I feel that what you're doing is yet another wonderful endeavor! I look forward to the future reception of Haku from the Japanese. I'm positive they will be excited!

If I may, my suggestion would be to also incorporate educational aspects in Haku -- adding support of turtle graphics, sprite objects, and "music objects," for instance. Its use could spread in the Japanese schools!

@Eidon There are already several Japanese programming language for educational use and one of them, Dolittle, ( has turtles. I don't think I can do a better job than they do.

I am not competing against these languages for educational use. Haku is not intended to be practical. I aim for an aesthetic of written literary Japanese.

I want to use my language for education in Computing Science, to explore the impact of grammar, syntax and semantics.

@Eidon The "music objects" idea is intriguing though, do you have an example or can you explain?

@wim_v12e With pleasure! Rather than objects I should have said "agents" though. I was thinking of agents generating sound and adapting to other sounds produced in their "vicinity". A little like it takes place when an improviser adjusts its playing to what its neighbors are doing, and at the same time it influences its neighbors with what it is playing... A vision rather than a clear idea for the moment ^_^'

@Eidon It is an interesting vision. What support would the programming language need to have to make that kind of agents possible?

@wim_v12e The simulation environment could be embedded in the language. The programmer would initiate agents and a "relationship grid" representing the "distance" between actors. The language could define callbacks fired by the proximity with other agents... Then, we could think of the music production. I suppose one could implement constructs similar to supercollider, for instance...

@Eidon So in terms of the program, this would this be purely declarative? Essentially you have a function to "create agent x with callback y",
and a function to "create relationship grid: distance from x1 to x2 = ..." ?

It seems to me you can do this in any language provided you can embed the simulator. But that means that the language runtime either supports threads or inter-process communication.

(I don't know what supercollider is, sorry. )

@wim_v12e Yes, I think it would be as you say -- I cannot think of another model right now...
Supercollider is a programming language and platform to create sound. A little like CSound, though apparently more powerful. I have read a tutorial for beginners and did some little experiments.

@Eidon I had a quick look. It looks very impressive. Realistically, I can't hope to integrate something like that into my little language as it would take an enormous amount of time. If there were of course volunteers to work on these aspects while I focus on the core language, that might work.
I think Haku is a bit too esoteric to attract a community of volunteers, but who knows?

@wim_v12e I see! Beautiful purposes. I hope I may soon start learning Haku -- and learn from Haku! ^_^

@Eidon Ah, sorry about that. The term "emitting" is compiler jargon. It means generating code for a certain target from an abstract syntax tree.
Racket is a popular Scheme implementation. Scheme is a standard with many different implementations.

In the meanwhile I decided that I will not target Scheme but instead Raku, so all you need is Raku 😄

@wim_v12e Looks great! I don’t know enough kanji to be able to read your example program but I can see its structure.

It is my firm belief that every computer scientist should design a Turing-complete language once in their careers. It brings together so many parts of computer science: data structures and algorithms; grammars and parsing; computational complexity; formal correctness.

@futzle I totally agree. This is by far not my first language, but it is the first time I design such an unconventional one.

Once you know the keywords for the core constructs in Haku, you would not need to know kanji. The language is pure, strict and functional so there is full referential transparency. I intend to create a romaji version and maybe an English equivalent one, but at my current rate of progress that will take a while.

Sign in to participate in the conversation

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!