脚本与编码 [英] Scripting vs. Coding

查看:109
本文介绍了脚本与编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

脚本和编码之间有什么区别?我都做过,我都能认出,但是实际上,定义是粗略的.首先,我是否假设您正在编码",您的代码"必须(能够)编译到某些系统的机器或程序集中,无论是x86程序集,Windows程序集(如MASM)还是微控制器程序集, 等等. ?我是否还可以假设脚本永远不会编译,它的文本只是通过诸如基于Microsoft Windows的脚本宿主"(VB-Script解析器)之类的处理程序运行的吗?我掌握了一些脚本和代码的特质,但是从最低的角度看,我对它们的编译感到困惑.另外,我假设如果脚本变成了某种形式的二进制文件,但未被操作系统或计算机(或微型计算机)本身处理,则它仍然是脚本.我对吗?我知道可以将代码编译"为不可运行的库",并且某些脚本语言可以运行其他脚本文件.

解决方案

您可能是对的,因为脚本"的定义不明确.我认为原始术语起源于一个不同的时代,当时的软件总是以C或Pascal等编译语言编写,然后可能以高级语言(脚本语言",例如VBA)进行定制或自动化.

但是,今天,整个系统都可以编写为非编译语言.实际上,这至少可以追溯到1987年, HyperCard 允许应用程序开发人员创建整个业务脚本语言和更高版本中的桌面应用程序可以将部分脚本编译为机器代码.

相反,现在某些应用程序已以编译语言进行自定义或自动化.例如,考虑可以在.NET(VB/C#是编译语言)中自动化的MS Office应用程序.

此外,通常不再解释非编译语言,而是 JITed .这意味着未编译的语言和已编译的语言之间的区别是模糊的.

因此,简而言之,我认为定义取决于上下文.在大多数情况下,我用术语脚本"指的是在不修改应用程序的情况下自动或自定义(以代码形式)由其他人创建的应用程序.

在编程大师中,Roberto Ierusalimschy在被要求描述语言时写了以下内容:

Lua是一种脚本语言,具有该表达的原始含义. 一种控制其他组件的语言,通常用另一种语言编写.

我真的很喜欢这个定义.

What is the difference between scripting and coding? I've done both, I can recognize both, but it seems in reality, the definitions are sketchy. First of all, am I right in assuming if you are "coding", your "code" must (be able to) compile into some system's machine or assembly, be it x86 assembly, windows assembly (like MASM), micro-controller assembly, etc. ? Am I also right to assume scripting doesn't ever compile, it's text is just run through a processing program like 'Microsoft Windows Based Script Host' (VB-Script parser)? I get some of the qualities of scripts and code, but on their lowest level, I'm confused about their compilation. Also, I assume if a script gets turned into some form of binary, but is not being processed by the OS or computer (or microcomputer) itself, it's still a script. Am I right? I know code can be 'compiled' into non runnable "libraries", and some scripting languages can run other script files.

解决方案

You are probably right in that the definition of 'scripting' is vague. I think the original term stems from a different era when software was always written in compiled languages such as C or Pascal and then possibly customized or automated in high level languages ('scripting languages', such as VBA).

Today, however, entire systems can be written non-compiled languages. Actually, this goes all the way back to at least 1987, HyperCard allowed application developers to create entire business desktop applications in a scripting language, and in later versions parts of the scripts could be compiled to machine code.

Conversely, some applications are now customized or automated in compiled languages. Consider for example MS office applications that could be automated in .NET (VB / C# are compiled languages).

Additionally, non-compiled languages are usually no longer interpreted, but instead JITed. This means that the distinction between a non-compiled language and a compiled language is blurred.

So, in short, I think the definition depends on context. In most cases where I have used the term, I refer to 'scripting' as automating or customizing (in code) applications created by someone else without modifying said application.

In Masterminds of Programming, Roberto Ierusalimschy writes the following when asked to describe the language:

Lua is a scripting language in the original meaning of the expression. A language to control other components, usually written in another language.

I really like that definition.

这篇关于脚本与编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆