有没有办法在不使用虚拟机的情况下在Smalltalk中进行开发?

发布于 2024-08-15 11:24:22 字数 135 浏览 8 评论 0原文

我真的开始学习Smalltalk了。现在我正在使用Squeak,但是有什么方法可以在不使用VM的情况下在Smalltalk中进行开发,但是像IDE之类的东西?

I'm really begining to learn Smalltalk. Now I'm using Squeak, but there is any way to develop in Smalltalk without using VMs, but something like an IDE?

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

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

发布评论

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

评论(6

情绪少女 2024-08-22 11:24:22

Smalltalk 中的映像类似于 VMware 机器:它只是正在运行的 Smalltalk 应用程序的冻结状态。 所有 Smalltalks都使用图像,并且使用图像进行开发是在所有Smalltalks中进行开发的首选方式。同样,所有 Smalltalk 都编译为字节码并在虚拟机上运行,​​就像 Java、.NET、Python 等一样。但这与您使用什么程序来开发 Smalltalk 程序以及体验的原生程度完全无关。

正如其他人提到的,Squeak 实际上附带了一个非常好的 IDE,即 Squeak 的全部。但是,我认为这并不是您真正要问的。据我所知,您的问题是以下一个或两个:

  1. 我可以用我熟悉的工具、我熟悉的方法为 Smalltalk 进行开发吗?例如,在普通文本编辑器中逐个文件?
  2. 我可以使用 Smalltalk 制作外观正常的应用程序吗?

我可以使用我熟悉的工具为 Smalltalk 进行开发吗?

对于第一个问题的回答:对于几乎所有 Smalltalks 来说,都不能。 Smalltalk 的文件格式旨在在 Smalltalk IDE 中进行操作,而不是直接在文本编辑器中进行操作。这就是为什么 Squeak、Pharo、VisualWorks、VisualAge 和我用过的所有其他 Smalltalk 都避免让您直接编辑源代码,而是提供它们自己的自定义 IDE。由于这些工具是跨平台的,因此它们的 IDE 通常不是原生的,而是代表了模拟的跨平台感觉。虽然您可以直接编辑所有这些系统的源代码(例如,您可以编辑 Squeak 图像的 foo.sources 文件,然后使用更改浏览器加载在你的编辑中),实际上没有人这样做。

在这方面,有两种方法可能会让您更快乐。首先,正如其他人指出的那样,GNU Smalltalk 打破了模式,并且实际上有一个编辑器 -友好的、基于文件的格式。我上次检查时,GNU Smalltalk 在 Windows 下运行得不好,并且是 GPL 许可的,这对您来说可能是个问题。但它确实允许您使用您选择的编辑器。 vim 和 Emacs 都具有 GNU Smalltalk 的语法突出显示功能,虽然我不知道 NetBeans、Emacs 或其他主要 IDE 之一的软件包,但编写一个软件包并不难。

如果您唯一担心的是 Squeak 看起来“丑陋”,您可以采取的第二条路线是使用 Dolphin Smalltalk。 Dolphin Smalltalk 是 Smalltalk 的 Windows 原生版本。虽然目前它的未来令人困惑,但您可能希望看一下它,因为如果 Squeak 打扰您,您可能会在其原生环境中感觉更自在。

我可以制作看起来原生的应用程序吗?

如果您想要真正的原生小部件,目前您几乎没有选择。 Dolphin 提供原生小部件,但是,正如我之前提到的,它的未来目前还不确定。 Squeak、VisualWorks 和 GNU Smalltalk 提供了很好的 FFI 系统,因此你可以制作原生 UI,但这样做会相对艰巨和复杂。所以,基本上:如果这对您来说非常重要,那么,现在,使用 Smalltalk 可能不是您的最佳选择。

请注意,对于许多应用程序来说,拥有本机小部件并不重要。游戏和信息亭当然不需要使用标准小部件,但如果你环顾四周,就会发现很少有主流应用程序愿意使用它们。微软自己的产品因具有定制的外观和感觉而臭名昭著,Chrome 在其运行的每个平台上看起来都格格不入,有趣的是,尽管 iTunes 在 Windows 系统上看起来确实很奇怪,但它却非常受欢迎,等等。网站上过多的界面也让人们更好地适应非标准界面。所以你很可能根本不在乎——而且由于 Squeak 的界面高度主题化,当你接近发货时让它看起来“漂亮”并不困难。

(GNU Smalltalk确实有非常好的 Gtk+ 绑定,您可能可以接受,这取决于您想要做什么。有一些主要的应用程序,例如 GIMP 和 Pidgin,是针对 Gtk+ 编写的不过,我很抱歉您没有考虑到这是一个可行的选择。)

我的建议

说实话,我强烈建议您找到一款带有 IDE 的 Smalltalks。你喜欢,并且使用它。与尝试使用文本编辑器相比,您的工作效率会高得多,无论它是像 Eclipse 这样的精美编辑器,还是像 Scite 这样蹩脚的编辑器。如果您走其他路线,您将错过 Smalltalk 的很多优点:没有 REPL、较差的调试、较差的代码浏览等等。

如果您坚持使用传统的开发环境,最好的选择是 GNU Smalltalk。在使用它之前,您应该仔细评估您是否对其在 Windows 上的稳定性和性能感到满意,并确保您对其 GPL 许可证的含义感到满意,但如果您满意,那么它是唯一真正认可的 Smalltalk。基于文件的开发模型。

An image in Smalltalk is analogous to VMware machine: it's simply a frozen state of a running Smalltalk application. All Smalltalks use images, and developing with one is the preferred way to do development in all Smalltalks. Likewise, all Smalltalks compile to bytecode and run on virtual machines, just like Java, .NET, Python, and others do. But that's completely unrelated to what program you use to develop a Smalltalk program, and how native the experience feels.

As others have mentioned, Squeak actually comes with an extremely good IDE—namely, all of Squeak. However, I don't think that's what you're actually asking. As best as I can understand, your question is either or both of:

  1. Can I develop for Smalltalk in tools I'm familiar with, in methods familiar to me? For example, on a file-by-file basis, in a normal text editor?
  2. Can I make normal-looking applications using Smalltalk?

Can I develop for Smalltalk in tools I'm familiar with?

In answer to the first: for nearly all Smalltalks, no. Smalltalk's file format was designed to be manipulated within a Smalltalk IDE, rather than directly in a text editor. That's why Squeak, Pharo, VisualWorks, VisualAge, and every other Smalltalk I've ever used avoid having you edit the source directly, and instead provide their own custom IDEs. Because these tools are cross-platform, their IDEs are generally not native, but rather represent an emulated cross-platform feel. While you can edit the source directly for all of these systems (for example, you can edit the foo.sources file for a Squeak image, then use the Change Browser to load in your edits), no one actually does that.

There are two routes that might make you happier in this regard. First, as others have pointed out, GNU Smalltalk breaks the mold, and does, in fact, have an editor-friendly, file-based format. GNU Smalltalk did not run well under Windows last I checked, and is GPL-licensed, which may be a problem for you. But it does allow you to use the editor of your choice. Both vim and Emacs have syntax highlighting for GNU Smalltalk, and while I'm not aware of a package for NetBeans, Emacs, or one of the other major IDEs, it wouldn't be very hard to write one.

The second route you could take, if your only concern is that Squeak looks "ugly," would be to use Dolphin Smalltalk. Dolphin Smalltalk is a Windows-native version of Smalltalk. While its future is confusing at the moment, you may wish to take a look at it, as you would probably feel much more at home in its native environment, if Squeak's bothers you.

Can I make native-looking applications?

If you want truly native widgets, you have few options at the moment. Dolphin provides native widgets, but, as I mentioned previously, its future is currently uncertain. Squeak, VisualWorks, and GNU Smalltalk provide good FFI systems, and you could therefore make native UIs, but doing so would be comparatively arduous and complicated. So, basically: if this is very important to you, then, right now, using a Smalltalk may not be your best option.

Note that there are many applications for which having native widgets is not important. Games and kiosks certainly do not need to use standard widgets, but if you look around, very few mainstream apps bother to use them, either. Microsoft's own products are notorious for having custom look-and-feels, Chrome looks amusingly out-of-place on every platform it runs on, iTunes is amazingly popular despite looking truly bizarre on Windows systems, and so on. The plethora of interfaces on websites have also better acclimated people to nonstandard interfaces. So there's the real possibility that you simply don't care--and as Squeak's interface is highly themeable, making it look "pretty" when you near shipping will not be difficult.

(GNU Smalltalk does have very good Gtk+ bindings, which may be acceptable to you, depending on what you're trying to do. There are major applications, such as The GIMP and Pidgin, written against Gtk+ that look just fine in Windows. Nevertheless, I'd pardon you for not considering that a viable option.)

My recommendation

To be honest, I'd strongly encourage you to find one of the Smalltalks with an IDE you like, and use it. You'll be vastly more productive then trying to use a text editor, whether it's a glossed-up one like Eclipse, or a crappy one like Scite. You'll be missing an awful lot of Smalltalk's greatness if you go other routes: no REPL, inferior debugging, inferior code browsing, and so on.

If you insist on using a traditional development environment, the best option is GNU Smalltalk. You should carefully evaluate whether you're happy with its stability and performance on Windows before using it, and make sure you're comfortable with the implications of its GPL license, but if you are, it's the only Smalltalk that really and truly endorses a file-based development model.

挽清梦 2024-08-22 11:24:22

Squeak 一个IDE。 “IDE”的概念可以说来自Smalltalk!您是否想要“面向文件”的工作流程? GNU Smalltalk 就是一种以这种方式工作的实现。

Squeak is an IDE. The concept of "IDE" arguably came from Smalltalk! Do you perhaps want a "file oriented" workflow? GNU Smalltalk is one implementation that works that way.

执妄 2024-08-22 11:24:22

一般来说,答案是否定的,因为 Smalltalk 不仅仅是一种语言,它也是环境,包括您对其所做的更改。您可以将其转换为具有框架的更静态的系统,而不是由活动对象组成的宇宙,但这将是另一回事。 NeXTSTEP 和 Cocoa 基本上就是这样做的。所以答案可能是“当然,它被称为 Objective-C”。

编辑:综上所述,请参阅 Logan 对 GNU Smalltalk 的引用。

Generally the answer is no because Smalltalk is not just a language, it's the environment too, including the changes that you make to it. You could translate it into a more static kind of system with a framework rather than a universe of live objects, but it would be a different thing. NeXTSTEP and thus Cocoa essentially did this. So the answer could be "sure, it's called Objective-C."

EDIT: All that said, see Logan's reference to GNU Smalltalk.

平安喜乐 2024-08-22 11:24:22

使用 VM 并不妨碍您使用 IDE。您应该问的问题是哪个 IDE 具有良好的 Smalltalk 集成。 是 Smalltalk IDE 的最佳选择

Squeak绝对 其他人考虑了其他 IDE,因为您已经在使用 Squeak 并且似乎并不满足。您到底在寻找哪些 Squeak 没有提供的功能?

Using a VM does not prevent you from using an IDE. The question you should be asking is which IDE has good Smalltalk integration. Squeak is definitely the way to go for a Smalltalk IDE

Maybe others have other IDE's in mind, since you are already using Squeak and don't seem to be content. What exactly are you looking for that Squeak is not providing?

葬心 2024-08-22 11:24:22

在 Squeak 图像中工作真的很有趣。

一开始环境有点混乱,但它非常强大。

在实时系统中工作可以轻松探索和改变事物。您可以在屏幕上查看对象的状态,使用它,浏览对象类,运行一些代码并查看世界的变化。

Smalltalk 浏览器也更注重“浏览”代码而不是编写代码。您可以快速找到使用类的所有位置(从编译器到 http 服务器)并了解它们是如何组合在一起的。

尝试一段时间来适应这个图像。我认为使用外部 IDE 会丢失一些东西。

Working in a Squeak image can be really fun.

The environment is a bit confusing at first but it's very powerful.

Working in a live system makes it easy to explore and change things. You can take an object on the screen look at its state, play with it, browse the object class, run some code and see the world change.

The Smalltalk Browser is also much more focused on "browsing" the code than writing it. You can quickly find all the places where a class is being used (from compiler to http server) and understand how it all fit together.

Try getting used to the image for a while. I think you would loose something by using an external IDE.

梦屿孤独相伴 2024-08-22 11:24:22

如果从 squeaksource 加载 SVI 项目,则可以在 Smalltalk 工具中使用 VI 绑定。我将其更新为在 Squeak 4.1 中运行,不确定 4.2 是否可以。

If you load the SVI project from squeaksource, you can use VI bindings in the Smalltalk tools. I updated it to run in Squeak 4.1, not sure about 4.2.

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