除了 JavaScript 和 PHP 之外,还有类似 C(语法)的脚本语言吗?
我正在寻找一个通用的(考虑到PHP实际上是为服务器端Web而设计的,最初的意思是(我知道它们有时会以不同的方式使用)用于服务器端Web和JavaScript用于客户端Web)与C/C++/C#/Java-就像语法一样。你知道这样的吗?
I am looking for a general-purpose (considering PHP is actually made and initially meant (I understand they are be used different ways some times) for server side Web and JavaScript for client-side web) with C/C++/C#/Java-like syntax. Do you know of such?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
Mythryl 是一种围绕 C 语法精心设计的通用脚本语言。
Mythryl is a general-purpose scripting languages deliberately designed around C syntax.
也许派克与鳍
Perhaps Pike with Fins
还有 Ch,一个嵌入式 C/C++ 解释器。
There's also Ch, an embeddable C/C++ interpreter.
只需查看编程语言比较,看看哪些最适合您的需求。您可能会使用动态类型系统来查看语言,因为它们是脚本语言。如果您需要入门,大肆宣传的语言包括 Scala、Ruby(带有 Ruby on Rails Web 框架)、Groovy 等。
Just look through the Comparison of programming languages, and see which ones fit your needs best. You might look at the language with dynamic Type Systems, because those are scripting languages. Hyped languages include Scala, Ruby (with the Ruby on Rails web framework), Groovy and others, if you need a start.
一般来说,维基百科的 C 语言条目列出了很多:“C 直接或间接影响了许多后来的语言,例如 Java、Perl、Python、PHP、JavaScript、LPC、C# 和 Unix 的 C Shell”
具体来说,对于与 C 非常相似的通用“脚本”语言,我强烈推荐 Perl,它完全符合要求。
Perl 的语法(或至少是它的子集)非常类似于 C (不幸的是,从 Perl 开始的前 C 程序员都以“C-ish Perl”风格编码,这几乎是直接的 C)。
除了一般语法思想之外,Perl 支持绝大多数 C 系统函数和许多其他 C 语言(例如,全功能
printf
、过程控制和 IPC)。如今,Perl 绝对是一种通用语言 - 它可用于从 Web 开发(包括 Catalyst MVC、Plack 等现代框架)到企业软件开发(包括成熟的服务器)、系统管理脚本和通用“脚本”等各种用途。 “粘合任务。
此外,它还支持面向对象编程(使用经典的 Perl OOP 或使用现代 Moose)以及函数式编程。
请注意,在评估 Perl 时,您不应依赖现有的众多神话 - 其中大多数都是要么是人们对 Perl 不够熟悉,要么是根据大量由非软件开发人员的系统管理员编写的代码质量很差的脏脚本来判断 Perl,或者根据 Perl 版本中的功能来判断 Perl。 15 年前流行(例如,1998 年左右对 Perl OOP 的任何批评几乎毫无用处,除非这样做的人非常熟悉 Moose)。
PS 由于您的问题似乎是在“...来自 PHP”上下文中,因此您还应该注意,PHP 实际上在设计上与 Perl 的子集非常相似。引用php.net:
事实上,PHP 最初是 Perl CGI 脚本的集合。
In general, Wikipedia's C language entry lists many: "C has directly or indirectly influenced many later languages such as Java, Perl, Python, PHP, JavaScript, LPC, C# and Unix's C Shell"
Specifically, for general-purpose "scripting" language that is very similar to C, I would strongly recommend Perl which fits the bill perfectly.
Perl's syntax (or at least a sub-set of it) is VERY C-like (to the point that ex-C programmers starting in Perl are unfortunately known to code in "C-ish Perl" style which is pretty much straight up C).
In additional to general syntax ideas, Perl supports a vast majority of C system functions and many other C-isms (e.g. fully functional
printf
, process control and IPC).Perl these days is definitely a general purpose language - it is used for anything from web development (including modern frameworks like Catalyst MVC, Plack etc...), to enterprise software development including full blown servers, to system administration scripting and general "scripting" glue tasks.
In addition, it supports both Object Oriented programming (either using classic Perl OOP or using modern Moose), as well as functional programming.
Please note that when evaluating Perl, you should not rely on the numerous myths that exist out there - most of these are due to either people not being sufficiently familiar with Perl, or judging Perl based on a large mass of poor-code-quality dirty scripts written by system administrators who weren't software developers, or judging Perl based on its features in Perl versions that were popular 15 years ago (e.g. any criticism of Perl OOP circa 1998 is pretty much useless unless the person doing it is closely familiar with Moose).
P.S. Since your questions seems to be in "...coming from PHP" context, you should also note that PHP is in fact very similar to a subset of Perl - by design. To quote from php.net:
Matter of fact, PHP started out as a collection of Perl CGI scripts.
我目前正在开发一个名为 Cpy 的新项目,使用 Python 的执行引擎,但用 C 语法编写代码。它是用 ANTLR 和 Python 构建的。看看它:http://www.ideawu.com/cpy/
I am currently working on a new project called Cpy, using Python's execution engine, but wrting codes in C-syntax. It is built with ANTLR and Python. Take a look at it: http://www.ideawu.com/cpy/
典当。不是通用目的(取决于您的定义),但作为小型嵌入式语言非常好。
Pawn. Not general purpose (depending on your definition) but very good as a small embedded language.