TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ko – A concurrent, immutable, functional language

116 pointsby petarover 6 years ago

19 comments

yiyusover 6 years ago
There is not a single example in the README. I checked the step-by-step guide, but it starts with installation and documentation instructions, then imports, and I don&#x27;t know yet how the language feels like. Ok, let&#x27;s check that handbook then. Computation model, type system, ...<p>Please, I just want to see a program with a dozen lines of code to see what it looks like. Of course, more extended examples with the intended usage would also be very welcomed.<p>I eventually found this: <a href="https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;examples&#x2F;helloworld.ko" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;e...</a> but I think it should be much easier to arrive there.
评论 #18618873 未加载
评论 #18619736 未加载
评论 #18619904 未加载
评论 #18620994 未加载
评论 #18625193 未加载
评论 #18621205 未加载
ivorasover 6 years ago
I can&#x27;t be the only one who&#x27;s annoyed by language writers introducing arbitrary uncommon syntax apparently just for the sake of doing something new?<p>Lua&#x27;s great little language but writing ~= instead of != is simply annoying. In this &quot;Ko&quot; language, it looks like they do returns with a colon, as in &quot;return: x&quot; -- why??? I won&#x27;t even go into Rust picking up Perl&#x27;s bad habit of looking like line noise with all the ASCII sigil usage in advanced code.<p>Also, any language which doesn&#x27;t have a &quot;hello world&quot; example in its front page is doomed. Even such a wide-spread language as Python has code snippets practically first thing on its web page! This is not by accident!
评论 #18626553 未加载
tombertover 6 years ago
I don&#x27;t want to be &quot;that guy&quot;, but a small sample in the README would be nice. Tough to tell if I&#x27;ll like a language if I can&#x27;t even see it without traversing through the docs.
choegerover 6 years ago
But what&#x27;s its type discipline? H&#x2F;M polymorphism? Overloading? Subtyping?<p>How is it evaluating? Eager? Lazy?<p>What values are supported? Records? What flavor? Modules?
评论 #18621903 未加载
kyleperikover 6 years ago
I love the generic function aspect of this, where there aren&#x27;t necessarily specific inputs or outputs. This will make code reusable by factors. A simple use being not needing to define both `toRadians` and `toDegrees`, just definite the relationship. But I believe this can be taken to the point of getting backpropagation for free once forward propagation is defined in neural networks.<p>Not to steal any thunder, but I&#x27;ve been prototyping a language very built on this idea.<p><a href="https:&#x2F;&#x2F;git.kyleperik.com&#x2F;kyle&#x2F;judo" rel="nofollow">https:&#x2F;&#x2F;git.kyleperik.com&#x2F;kyle&#x2F;judo</a>
评论 #18619984 未加载
vmchaleover 6 years ago
Is this a research language? I don&#x27;t understand how this offers anything beyond what already exists.<p>I&#x27;m also suspicious of the fact that it&#x27;s implemented in Go. I would think that someone who knew functional programming well enough to create a new language would implement the language in Haskell or OCaml or even Standard ML.<p>Also the type system looks pretty bad. No algebraic data types.
评论 #18619863 未加载
评论 #18619747 未加载
评论 #18621803 未加载
samatmanover 6 years ago
I just want to say that &quot;Ko&quot; is an excellent name for a deadlock-free language written in Go. Kudos.
评论 #18622515 未加载
thosakweover 6 years ago
Found the examples: <a href="https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;tree&#x2F;master&#x2F;lessons&#x2F;examples" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;tree&#x2F;master&#x2F;lessons&#x2F;e...</a>
weberc2over 6 years ago
This is interesting. I see it has an interpreter, but it&#x27;s unclear at a glance whether &quot;interpreted&quot; is the default production mode of the language or if the interpreter is available to facilitate a repl or smething.<p>Skimming some of the .ko files, I like that it seems readable and familiar (even if there are some oddities). No matter how much time I spend with Haskell and OCaml, I always spend conscious effort trying to mentally parse the source code.
notduncansmithover 6 years ago
This reminds me a lot of a library I wrote called Factfold (<a href="https:&#x2F;&#x2F;github.com&#x2F;notduncansmith&#x2F;factfold" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;notduncansmith&#x2F;factfold</a>).<p>Something I noticed while working on it is that the declarative style is not always the most comfortable way to describe things, and well-written imperative code is declarative in its own way. Somewhere in most useful programs, it helps to have the imperative escape hatch until you can support the best declarative expression.
heavenlyhashover 6 years ago
Interesting.<p>Random observations in no particular order:<p>- The simple assignment syntax <i>looks</i> somewhat procedural and is easy to read in small hunks at a time, but is still functional. I like this. This meshes well with the very real limits of how the human brain can parse things.<p>- I wish there were type declarations. There&#x27;s a type system, but it seems to be <i>all</i> inference. Type declarations just at the function inputs and outputs (and leaving it pure inference in the middle) would promote readability when you&#x27;ve got no compiler in hand and are just eyeballing the pure text, in my opinion.<p>- I&#x27;m surprised by the inclusion of a system of nonlocal returns (panic&#x2F;recover). It still looks <i>relatively</i> functional, but A) boy that&#x27;s not an area where the word &quot;relatively&quot; is comfortable to use and B) I shudder to think what the inferred types will tend to explode into when using this feature (an Either of an Either of an Either of a ...?) in a nontrivial program (and the examples don&#x27;t really shed light on that either, due to the &quot;all inference&quot; model leaving us with no plain text declarations of types in sight).<p>- I haven&#x27;t seen any examples yet of what happens and how you&#x27;re supposed to resolve it when the type inference can&#x27;t quite figure it out. There seem to be some examples of doing explicit casts which seems to be a workaround for this, but I don&#x27;t see it discussed very clearly.<p>- The quick and easy syntax for returning new record&#x2F;structure types seems nice. Though I&#x27;m again a tad worried that the range of types I could end up producing would get pretty large.<p>- The syntax holistically seems to keep things from &quot;drifting to the right&quot;, which seems to be a common readability cramp that emerges in many functional languages. Nice.<p>- Using the term &quot;Variety&quot; for roughly &quot;closure&quot; is... very nonobvious to me. But I shouldn&#x27;t nitpick on terminology. (And for what it&#x27;s worth, I read the protobuf that Ko uses internally to define its types of types before anything else, and so maybe I&#x27;d be less surprised if I had encountered it from from the docs and lessons first.)<p>Caveat: these are all &quot;hot takes&quot; from the couple dozen minutes of digging I&#x27;ve done so far. I might be reading some things wrong or have missed some documentation, so take these comments with a grain of salt and do your own looking as well.<p>Overall, this seems neat, but simultaneously leaves me a little worried that I&#x27;d be able to too easily write things in which the type inference finds something that compiles, but isn&#x27;t the type that I would&#x27;ve declared.<p>I&#x27;d be really interested to see what this shapes up like if combined with some system for explicit type declaration. Gluing Ko together with a serial data schema like Protobuf and using Ko for &quot;migrations&quot; seems like it could be a really useful combination, for example.
评论 #18619577 未加载
minionslaveover 6 years ago
Would it be possible to have a small hello world example in the README?
simcop2387over 6 years ago
Couldn&#x27;t find it easily, but what model are they using to make this dead-lock free as they advertise? I&#x27;ve seen a number of languages try to accomplish this same goal but usually with a huge caveat on what kinds of programs are allowed, or by randomly killing threads when a dead-lock is detected.
评论 #18622049 未加载
jerfover 6 years ago
Hot takes, as someone else says:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;1-basics&#x2F;1-files-packages-imports.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;1...</a> : You might want to consider using Go syntax whenever it is not a problem. &#x27;import &quot;package&quot; as foo&#x27; rather than &#x27;import foo &quot;package&quot;&#x27; is just pointless change, unless there&#x27;s more to the &quot;as&quot; statement later.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;1-basics&#x2F;3-arguments.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;1...</a> : Whoa, I have to type the name of all the arguments I want to use to every function on every invocation? That&#x27;s a level of noise I&#x27;m not interested in. In <a href="https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;1-basics&#x2F;4-default-arguments.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;1...</a> it is claimed this is necessary to support default arguments, but see Python&#x27;s function argument invocations. (And be sure you see <i>all</i> of it; for instance, it is little known that you can:<p><pre><code> &gt;&gt;&gt; def f(x): ... return x * 2 ... &gt;&gt;&gt; f(x = 2) 4 </code></pre> that is, even a positional parameter can be passed by name if you insist.)<p>Coming back after reading on, I see you let Eq and Sum and such get by without argument names. Generally a language should not reserve privileges for itself that it does not grant to its users without a really good reason.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;1-basics&#x2F;4-default-arguments.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;1...</a> : I literally have no idea how you are using the word &quot;monadic&quot; in this section; it is neither the proper mathematical term, nor the very close Haskell term, nor any subsequent misunderstanding I&#x27;ve ever seen of the Haskell term ported into other languages, nor can I particularly connect it to the philosophical meaning, nor do I (glancing ahead) see any other documentation for it. My search was not exhaustive, but taking such liberties with a term like that sets off a lot of flags for me.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;1-basics&#x2F;5-intermediate-steps.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;1...</a> : This is, IMHO, a rather dirty hack around trying to copy the way pure Haskell code can implement definitions without much concern for order, while at the same time having side effects in the code. That &quot;DoubleGreeting&quot; on the bottom is getting really ugly (and I mean in terms of the semantics of what is being represented there, not the surface syntax layer), and it&#x27;s still in the sample code, where things should be looking artifically fake-pretty because the real-world hasn&#x27;t intruded yet. It&#x27;s a solution to a problem that shouldn&#x27;t have been introduced in the first place.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;3-types-and-values&#x2F;6-structures.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;3...</a> : I expect &quot;repeated assignment&quot; will be difficult to follow with nested structures. Also, what happens if I move yearOfBirth below the repeated &quot;occupations&quot;? My point here is not that there isn&#x27;t an answer; it&#x27;s that I can come up with 3 or 4, which is the real problem.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;3-types-and-values&#x2F;7-varieties.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;3...</a> : Variety is a bad name for this concept. It&#x27;s too close to the well-defined &quot;variant&quot; term and causes serious concept clash in my head. &quot;Function object&quot; or something, maybe. &quot;Closure&quot; might work, haven&#x27;t studied it closely enough to be sure.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;3-types-and-values&#x2F;7-varieties.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;3...</a> : This appears to mean that the &quot;null&quot; value is forced into all types, which makes this, surprisingly, even worse than Go itself on this front, which at least has a few types of values that can&#x27;t be null.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;3-types-and-values&#x2F;9-equality-and-hashing.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;3...</a> : At scale, you can&#x27;t provide a generic hashing function. It&#x27;s appealing, but it really can&#x27;t be done. At best you can provide an interface. Don&#x27;t even provide a default implementation. Java has had a long history of problems with that.<p>General comment: Using the functions for flow control is OK, but combining that with arbitrarily-reorderable function argument parameters is crazy. Anyone who writes If(else: ..., when: ..., then: ...) is just insane anyhow, so don&#x27;t even allow it in the syntax&#x2F;grammar, because it <i>will</i> happen. It seems to me you basically have an imperative language trying to look functional, while I see little to nothing &quot;functional&quot; about it, and you&#x27;d be better off just being an imperative language and take advantage of structured programming&#x27;s implicit control flow &lt;-&gt; source code layout correspondence. You&#x27;re paying the price for some things you&#x27;re not successfully taking advantage of.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;5-debugging-and-logging&#x2F;1-logging-with-show.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kocircuit&#x2F;kocircuit&#x2F;blob&#x2F;master&#x2F;lessons&#x2F;5...</a> : Re: arg0, arg1, arg2, etc., another solution to a problem that should simply have not been introduced.<p>My summation is that even in the examples, I&#x27;m seeing a lot of little quibbles stack up and become some big problems, and that&#x27;s before I&#x27;m trying to actually code in this. I&#x27;d suggest some more thinking about the language&#x27;s goals, and ensuring that every feature is in harmony with that goal and everything not necessary for it has been cut, because that is not where this language is right now.
Eli_Pover 6 years ago
What&#x27;s the main advantage of Ko over Go and Pony[1]? I never coded in any of them, but looks interesting.<p>[1] <a href="https:&#x2F;&#x2F;www.ponylang.io&#x2F;discover&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.ponylang.io&#x2F;discover&#x2F;</a>
pier25over 6 years ago
Is this like Haxe?
jackhalfordover 6 years ago
.ko is already used for kernel objects :(
评论 #18619151 未加载
pulsarpietroover 6 years ago
Y.A.U.L.
hota_maziover 6 years ago
&quot;Active development&quot; but the last commit was two months ago...