简体   繁体   English

在clojurescript中编写javascript脚本

[英]Scripting javascript in clojurescript

I'm looking for easier/ faster ways to build client side web apps and was told that I should look into Clojurescript. 我正在寻找更容易/更快的方法来构建客户端Web应用程序,并被告知我应该查看Clojurescript。

Can you use Clojurescript to script javascript to run in a web browser? 您可以使用Clojurescript编写javascript脚本以在Web浏览器中运行吗? Is there some benefits to scripting in clojurescript than regular javascript? clojurescript中的脚本比常规javascript有什么好处吗?

What's the differences between Clojurescript and Typescript/ Coffeescript in relation to faster/ easier development? Clojurescript和Typescript / Coffeescript在更快/更容易开发方面的区别是什么?

Yes you can. 是的你可以。 Clojurescript is a functional language that (because of its immutable data structures) is well suited to working with Facebook's React. Clojurescript是一种函数式语言(由于其不可变的数据结构)非常适合与Facebook的React一起工作。 There are a variety of React-based frameworks/libraries to choose from, and an active community to help you. 有各种基于React的框架/库可供选择,还有一个活跃的社区可以帮助您。

One of the advantages is that you get 'live coding' - this means that all you need to do is save your code and it will be automatically compiled and running in your browser. 其中一个优点是您可以获得“实时编码” - 这意味着您需要做的就是保存代码,它将自动编译并在您的浏览器中运行。 See Figwheel for this. 为此,请参见Figwheel。

Also your production code will be only be as large as it needs to be due to the use of Google Closure's Dead Code Elimination. 此外,由于使用了Google Closure的死代码消除功能,您的生产代码将只有它所需的大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM