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.

Neugram – Scripting in Go

236 pointsby golangnewsover 7 years ago

15 comments

kornishover 7 years ago
&quot;Go is syntactically a big language. Neugram’s front end has to match it, and that’s a lot of work, much of which is still to do.&quot;<p>I appreciate the sentiment – that there&#x27;s a lot of work left to do – but isn&#x27;t the assertion about syntax size false? I thought Go&#x27;s syntax was quite small compared to other popular languages? It only has 25 reserved words (Java has 50+) and was designed in part to be uniform and easy to read.
评论 #15623244 未加载
评论 #15623866 未加载
评论 #15623903 未加载
bakulover 7 years ago
How does this compare with <a href="https:&#x2F;&#x2F;github.com&#x2F;cosmos72&#x2F;gomacro" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;cosmos72&#x2F;gomacro</a> which does something very similar? It seems fairly complete, or at least much further along than neugram + it does lisp style macros! If you ignore the macros its language is pretty much go except that main(){ ... } is elided just like in ng.<p>May be worth checking it out, at least for ideas&#x2F;inspiration.
indescions_2017over 7 years ago
100% behind you on this, crawshaw. Although I&#x27;ve never missed having a Python style REPL for golang (&quot;go run&quot; usually fits the bill). You make a convincing argument for why it would indeed be a very powerful tool for any Linux admin&#x27;s toolbox ;)<p>It&#x27;s premature for feature requests I know. But I&#x27;d love to be able to view the Stack Trace of a live running goroutine. Typically something I log to disk using the &quot;runtime&quot; calls. To be able to probe that info from a command shell would be neat, don&#x27;t you think?
tedunangstover 7 years ago
It&#x27;s not clear to me where I would go from this page to try it out, or install it, etc.
评论 #15623163 未加载
dom96over 7 years ago
This is really cool, but I can&#x27;t help but suggest another language which works incredibly well for scripting: Nim[1].<p>Of course, I must put a disclaimer: I am incredibly biased as I am of Nim&#x27;s core developers. But to help convince you, Nim has:<p>* Shebang support<p>* Error handling via exceptions<p>* A somewhat limited REPL<p>* Operator overloading<p>While I applaud the author&#x27;s efforts, I can&#x27;t help but wonder if Nim would fit their needs (or be easier to adjust to their needs).<p>1 - <a href="https:&#x2F;&#x2F;nim-lang.org" rel="nofollow">https:&#x2F;&#x2F;nim-lang.org</a>
评论 #15623106 未加载
评论 #15623187 未加载
dragonfaxover 7 years ago
I like this. Especially the error handling. Since the focus on a scripting language can be brevity (Ala perl) I don&#x27;t want to write all that error handling boilerplate. But I don&#x27;t want to ignore issues either. So this is a compromise. I can check errors, I can capture errors (in _) to ignore them. But if I don&#x27;t do anything, they turn into panics.
rileytgover 7 years ago
this reminds me of the effort to replace a lot of the intel management stuff with linux and have userland all written in go<p><a href="https:&#x2F;&#x2F;schd.ws&#x2F;hosted_files&#x2F;osseu17&#x2F;84&#x2F;Replace%20UEFI%20with%20Linux.pdf" rel="nofollow">https:&#x2F;&#x2F;schd.ws&#x2F;hosted_files&#x2F;osseu17&#x2F;84&#x2F;Replace%20UEFI%20wit...</a>
frou_dhover 7 years ago
Glad to see this using <a href="http:&#x2F;&#x2F;github.com&#x2F;peterh&#x2F;liner" rel="nofollow">http:&#x2F;&#x2F;github.com&#x2F;peterh&#x2F;liner</a> for interactive line editing.<p>I used that package in an interpreter of my own and it works wonderfully to provide `readline` style keyboard interaction in a pure Go program.
评论 #15625052 未加载
weberc2over 7 years ago
It seems like something like this would be useful for a Jupyter kernel. I don&#x27;t think I&#x27;d use this as an embedded scripting language; it doesn&#x27;t offer enough in terms of abstraction and conciseness to justify leaving Go. I&#x27;d probably try for a lisp.
评论 #15623109 未加载
jeffinhatover 7 years ago
This is awesome. I&#x27;ve been trying to reach for go instead of bash more and more and this is exactly what I need for the small stuff.<p>Any ideas how it could relate to the go toolchain? could I stick my Neugram files in a repo and go get them?
评论 #15623486 未加载
ericfrederichover 7 years ago
No shebang support? What about this? Sure it&#x27;s not &quot;native&quot; but it accomplishes the same thing.<p><a href="https:&#x2F;&#x2F;rosettacode.org&#x2F;wiki&#x2F;Multiline_shebang#Go" rel="nofollow">https:&#x2F;&#x2F;rosettacode.org&#x2F;wiki&#x2F;Multiline_shebang#Go</a>
singularity2001over 7 years ago
even cleaner python: with open(&quot;hello.txt&quot;,&quot;w&quot;): f.write(&quot;Hello, World!&quot;)
loxover 7 years ago
This will be amazing for plugins!
wybiralover 7 years ago
Sometimes switching between Go and C is weird (because of the type order or the semicolons) but I&#x27;ve never had any trouble switching between Go and Python.<p>Go has an awesome ecosystem for writing servers and web applications but it&#x27;s obvious that the libraries weren&#x27;t built for scripting purposes and the language is more explicit (for good reasons).<p>Python, on the other hand has an ecosystem that&#x27;s great for scripting and language features that are more compact and terse.
评论 #15623370 未加载
nanodanoover 7 years ago
You can already &quot;go run program.go&quot; from anywhere, even outside of a project structure, which is the same result as running an interpreted script.<p>It&#x27;s a novel idea but I don&#x27;t really see it taking off. Is there really that much benefit to having a shebang at the top of the file versus executing &quot;go run&quot; and is it really worth having a REPL for a fairly verbose language? I certainly don&#x27;t see myself wishing for a Java REPL, and I don&#x27;t particular see myself reaching for a Go REPL either.
评论 #15623265 未加载