TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Compiled and Interepted language?

1 点作者 pkc超过 15 年前
Is it possible for a language to be both compiled as well as interpreted.<p>* During development we can use interpreter to rapid application development * In production environment same code base gets compiled to machine code or bytecode for performance reasons<p>Is it possible? Or is it a stupid idea?

5 条评论

pmarin超过 15 年前
Actually the different between compiled and interpreted language is very weak. For example, when you compile a C program the result is a code in a machine language and the machine language is "interpreted" by the Control Unit of the processor but if you are running the machine code in a emulator it is actually interpreted by the emulation layer.
ErrantX超过 15 年前
Although it's not quite what you mean there is Cython - it's a Python extension to Distutils that lets you convert Python code to C &#38; compile it.<p>We actually use this in the way you describe - using the interpreter as our test bed but compile it via Cython (for code protection and speed reasons) on deployment.
towndrunk超过 15 年前
I'm not so sure skipping compilation is going to give you rapid development.
评论 #950286 未加载
jpr超过 15 年前
I think Common Lisp standard requires implementations to have both interpreter and compiler, but allows some freedom how to do it. Some implementations compile to byte code (I think CLISP does this), and some compile to native code on the fly (SBCL). Haskell and OCaml also have both interpreters and compilers available. So yes, it is quite possible.
njn超过 15 年前
Yes it is possible. There are countless examples. ghc is one.