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.

DSL processing in Scala

40 pointsby dpapathanasioualmost 10 years ago

7 comments

dpapathanasioualmost 10 years ago
I&#x27;m still a scala newbie, so any comments&#x2F;suggestions are appreciated.<p>The full source code is here: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;dpapathanasiou&#x2F;b9d85685a0381f1deea0" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;dpapathanasiou&#x2F;b9d85685a0381f1deea0</a>
评论 #9954468 未加载
rco8786almost 10 years ago
You should check out the Parser package in the scala standard lib. I maintain a few DSLs using this and it&#x27;s an absolute dream.<p><a href="https:&#x2F;&#x2F;wiki.scala-lang.org&#x2F;display&#x2F;SW&#x2F;Parser+Combinators--Getting+Started" rel="nofollow">https:&#x2F;&#x2F;wiki.scala-lang.org&#x2F;display&#x2F;SW&#x2F;Parser+Combinators--G...</a><p>Code looks solid otherwise...at least where I work the style would be to favor functional idioms over for loops but I think that&#x27;s just personal preference.
评论 #9954001 未加载
评论 #9953719 未加载
sklogicalmost 10 years ago
Just for fun and to illustrate what&#x27;s in my opinion is wrong with Scala approach to DSLs, implemented the same DSL using a specialised meta-language: <a href="http:&#x2F;&#x2F;bit.ly&#x2F;1U2PGlV" rel="nofollow">http:&#x2F;&#x2F;bit.ly&#x2F;1U2PGlV</a><p>The meta-language is available here: <a href="https:&#x2F;&#x2F;github.com&#x2F;combinatorylogic&#x2F;mbase" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;combinatorylogic&#x2F;mbase</a>
tlarkworthyalmost 10 years ago
For DSL implementation see string interpolation, <a href="http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;10708136&#x2F;how-to-create-dsl-in-scala-for-command-lines-with-minimum-extra-boilerplate" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;10708136&#x2F;how-to-create-ds...</a>
birdsboltalmost 10 years ago
This doesn&#x27;t seem to solve the puzzle. As much as DSL processing part is done, the whole point of the puzzle was to make the operations sublinear in time complexity.
anon3_almost 10 years ago
To anyone here who works on a large, scala codebase as a team: how do you manage compilation times and narrowing code standards to a manageable set of idioms?
评论 #9953074 未加载
评论 #9953717 未加载
_pmf_almost 10 years ago
Yuck. No wonder Lispers look down on us.