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.

Tokay Programming Language

96 pointsby wazbugabout 3 years ago

10 comments

stewbrewabout 3 years ago
&quot;You can exit the Tokay REPL with Ctrl+C.&quot;<p>Other repls often use ctrl-d for end of Input Stream instead. Ctrl-c is rather expected to Interrupt the programme execution, not the repl.
评论 #31363933 未加载
评论 #31364550 未加载
keithnzabout 3 years ago
Really could do with some &quot;Wow that&#x27;s cool&quot; examples.
评论 #31363442 未加载
评论 #31363299 未加载
ianthehenryabout 3 years ago
I am very interested in this project as a &quot;better awk&quot; is something I have often fantasized about.<p>I read all of the documentation that&#x27;s available on <a href="https:&#x2F;&#x2F;tokay.dev&#x2F;tokay-docs&#x2F;" rel="nofollow">https:&#x2F;&#x2F;tokay.dev&#x2F;tokay-docs&#x2F;</a>, but unfortunately it never really... describes itself? Many sections, including the section on &quot;parselets&quot; are just unwritten. &quot;Consumable&quot; values are mentioned but never described (there is a &quot;stub&quot; section that doesn&#x27;t really explain what the term means).<p>It begins with a pretty detailed description of value &quot;severity&quot; but doesn&#x27;t really motivate why the concept exists. (I <i>think</i> that it&#x27;s (basically) a way to very concisely discard certain matches? When there are &quot;more important&quot; matches around them?)<p>There are no examples of how I could use Tokay to &quot;parse&quot; something -- there are lots of examples dotted through the docs, but none of them demonstrate working with structured file formats, and they feel a little bit contrived.<p>I&#x27;m not complaining here: this project is not making any false claims about its status, the docs are clearly and explicitly unfinished, it is very clear that Tokay is still under active development.<p>But I want to learn more about it! I came away from this with a sense that it has the potential to be really useful to me, but without any concrete evidence to support that. I guess the next step is to download the source and start reading through the tests.<p>All this to say: please highlight some examples showcasing situations where Tokay shines! (Parsing CSVs containing quoted strings was making the rounds recently, right? What does that look like in Tokay?)<p>Oh, actually, the GitHub readme has an example that is more involved than any in the documentation: <a href="https:&#x2F;&#x2F;github.com&#x2F;tokay-lang&#x2F;tokay" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tokay-lang&#x2F;tokay</a><p><pre><code> _ : [ \t]+ # redefine whitespace to just tab and space Factor : @{ Integer _ # built-in 64-bit signed integer token &#x27;(&#x27; _ Expr &#x27;)&#x27; _ } Term : @{ Term &#x27;*&#x27; _ Factor $1 * $4 Term &#x27;&#x2F;&#x27; _ Factor $1 &#x2F; $4 Factor } Expr : @{ Expr &#x27;+&#x27; _ Term $1 + $4 Expr &#x27;-&#x27; _ Term $1 - $4 Term } Expr _ print(&quot;= &quot; + $1) # gives some neat result output</code></pre>
评论 #31364985 未加载
评论 #31364393 未加载
sshineabout 3 years ago
A first impression reading the &quot;Getting started&quot;:<p><a href="https:&#x2F;&#x2F;tokay.dev&#x2F;getting-started&#x2F;" rel="nofollow">https:&#x2F;&#x2F;tokay.dev&#x2F;getting-started&#x2F;</a><p>How does the Tokay executable know that some argument is a string vs. a file?<p><pre><code> # What if I have a file named &quot;save the wales&quot;? tokay program.tok -- file.txt tokay program.tok -- &quot;save the wales&quot; # What if I have a file named &#x27;.+&#x27;? tokay program.tok tokay &#x27;.+&#x27; </code></pre> This feels like someone thought this was neat because you don&#x27;t need to specify `-e`, but it comes at the cost of ambiguity where your program does something different depending on the filesystem. This has a cost in environments where you&#x27;re not in full control (e.g. when you distribute your executable for others to use).
josephgabout 3 years ago
Hey! Cool project. Why would I use this instead of python&#x2F;javascript&#x2F;rust&#x2F;etc? Can you give some examples where Tokay shines compared to these languages?<p>It&#x27;d be great to add those examples to the homepage! I had to dig a few levels deep to see what the language looked like. Clicking &quot;Getting started&quot; then scrolling all the way to the bottom seems like a lot of work to answer the question of &quot;why should I care about this?&quot;.
评论 #31362823 未加载
评论 #31368938 未加载
samatmanabout 3 years ago
This might be really cool! The idea is solid.<p>I must conclude that Tokay is too immature to use however. If it wasn&#x27;t it would clearly display, within one click of the home page, the similarities and differences between awk and tokay, because that&#x27;s what a developer would care about as opposed to anything else, and that feedback will be consistent so it must be very new.<p>Good luck, look forward to seeing it again some day.
Trufaabout 3 years ago
I&#x27;m working on a side project that is slightly related to this, where you can basically use JS to quickly transform text any way you want.<p>It would be really interesting to include many other languages other that JS and this one looks like a great fit (eventually).<p>If anyone want&#x27;s to give it spin you can but ONLY SOME FEATURES WORK HERE AND I WILL BREAK THE STUFF YOU DO! IT&#x27;S NOT EVEN ALPHA O BETA JUST BEING DEVELOPED. <a href="https:&#x2F;&#x2F;texttransform.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;texttransform.io&#x2F;</a><p>That said I am interested on HN&#x27;s point of view of this idea even if very raw, specially people interested in text transformation.
alimovabout 3 years ago
The language looks pretty neat, has anyone had any experience with using it in their personal projects or work setting?
HelloNurseabout 3 years ago
Is it good at parsing context sensitive languages, for example XML?
c_o_n_v_e_xabout 3 years ago
Great name! Love hearing these guys when you get away from the cities.
评论 #31364271 未加载