在服务器端和客户端使用 clojurescript 构建网站

发布于 2024-11-26 17:37:10 字数 83 浏览 1 评论 0原文

我正在考虑使用 ClojureScript 构建一个网站。在客户端和服务器端都编写 ClojureScript 是否有意义,就像 Node.js 一样?

I am considering building a website using ClojureScript. Does it make sense to write ClojureScript on both the client side and the serverside, much like node.js?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

银河中√捞星星 2024-12-03 17:37:10

这是可能的,但绝对没有理由不在服务器端使用 Clojure 本身,并且您将获得更好的性能和更好的库可用性。 Clojurescript/Clojurescript 的接口并不比 Clojure/Clojurescript 更容易。

我建议这样做的唯一情况是,您已经完全致力于服务器端 javascript 基础设施(例如,节点)并且想要编写 Clojurescript 而不是 Javascript。

It's possible, but there's absolutely no reason not to use Clojure itself on the server side, and you'll get better performance and much better library availability. Interfacing Clojurescript/Clojurescript is no easier than Clojure/Clojurescript.

The only situation where I'd recommend this is where you're already fully committed to a server-side javascript infrastructure (e.g, node) and wanted to write Clojurescript instead of Javascript.

乱世争霸 2024-12-03 17:37:10

JVM 和并发参数似乎很重要。并且 clojure/clojurescript 非常相似,因此在客户端和服务器中使用相同语言的参数在这里似乎并不重要。

对于服务器(nodejs)上的 clojurescript,我们有这个 MACCHIATO 它类似于环。

The JVM and concurency argument seems important.And clojure/clojurescript are very similar so the argument to use same language in client and server doesnt seem important here.

For clojurescript on the server(nodejs) we have this MACCHIATO its similar to ring.

清晰传感 2024-12-03 17:37:10

@对 Levand 的回复:(不是真正的答案,我只是一个普通人,主要是 php 程序员)。所以。我真的(如果可以的话)敦促莱万德进一步发展他的答案。只是不明白,仅此而已。我非常喜欢 Lisp 的一些特性(特别是计划中相当不寻常的宏语法)。因此,我希望他(如果他知道的话)或任何其他人告诉我这件事。有什么不好的呢。我根本不认为有什么不好。相反,我更喜欢它(不幸的是我自己没有在浏览器中使用 clojurescript)。我脑子里唯一能想到的坏事就是。

  1. 很难衡量性能(因为它是为 java 引擎构建的)。
  2. 亚格尼。
  3. 相当深奥,即接管主页或服务器的人可能不想学习它。 (问题太多,答案太少)。

如果 Gambit-Scheme 对于 unix 脚本编写者来说是一个很好的工具,那么我看不出在浏览器或服务器中使用一些不错的 Clojurescript Lisp 会出现什么问题。 (正如你所看到的,我很难称自己为一个优秀程序员。我全职使用了 Debian 两个月,然后向自己保证 Debian 和 Ubuntu 不适合我,尽管它并不算坏。只是感觉它让我想要简单的事情变得复杂了)。如果不是为了学习和实验的乐趣。 (尝试从新的方向看待问题,或者说“跳出框框思考”)。如果 Zubair 能够分享他对将 clojurescript 集成到 html 的想法我会非常高兴。 /糟糕的程序员在学校里被另一个糟糕的程序员欺骗了,并且很高兴他学会了它。虽然这是一次相当令人沮丧的经历。 将球扔到空中,希望有人能捡起来。

@A reply to Levand: (Not a real answer and I am just a plain human being who is mainly a php programmer). So. I really really (if you can) urge levand to futher develop his answer. Just don't get it, thats all. I am a big fan of some lisp features (especially a rather unusual macro syntax in scheme). Therefore I would like him (if he knows it), or anybody else for that matter to tell me. Whats so bad about it. I don't see anything bad at all. On the contrary I rather like it (havn't used clojurescript in the browser myself unfortunately). The only bad thing I can think of on the top of my head is.

  1. Hard to measure performance (since it was buildt for the java engine).
  2. YAGNI.
  3. Rather esoteric i.e. the possibuility that someone who takes over the homepage or server might not want to learn it. (So many questions so little answers).

If Gambit-Scheme can be a good tool for a unix scripter then I can't see what the problem is with having some nice Clojurescript Lisp in the brower or server. (As you can see I can hardly call myself a good programmer. F.e. I used Debian full time for 2 months then promised myself that Debian and Ubuntu was not for me, although it hardly was bad or so. Just the feeling that it complicated things that I wanted to be easy). If not so for the fun of learning and experimenting. (Tries to see the problem in a new direction, or so to say, "thinking outside the box"). If Zubair could share his thoughts on the matter of integrating clojurescript in html I would be more than happy. /Bad programmer who was tought scheme in school by another bad programmer and is very happy he learned it. Although it was a rather frustrating experiance. Throws the ball away in the air, hoping that someone can take it up.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文