问题标签 [platform-independence]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
121 浏览

java - 术语“平台无关”在编程语言环境中的相关性

也许我在这里问了一个非常明显和愚蠢的问题,但我在谷歌上什么也得不到,所以我开始了:

为什么有这么多关于 Java 是平台独立的事实而其他一些语言不是。我的意思是,就我的理解而言,总的区别只是编译步骤的存在/不存在,不是吗?

在 Java 中,当您在不同平台上运行字节码时,您不必再次编译代码,而在 C 或 C++ 中,您必须再次编译代码才能在不同平台上运行它(Am我错了吗?)。

因此,依赖于平台只是意味着多了一个编译步骤。这太多了吗?我在编程方面没有太多经验,所以也许我在这里遗漏了一些明显的实用点。

0 投票
1 回答
578 浏览

rust - 如何在 crate 安装中包含文本文件

我的程序在我的本地机器上按预期工作。它以 Emacs “Spook” 游戏 (Mx spook) 的方式从文本文件中打印随机行。文本文件位于src/spook.lines.

但是如果我将它作为 crate 发布并安装它,则找不到文本文件(因为src/spook.lines如果程序是从 crates.io 安装的,则它不在其中):

我包含文件的方式是:

为什么我不能只告诉货物/板条箱包装包含文本文件?首选方式是什么?我的意思是即使我将文件包含在某个目录中,它也不会在PATH执行中,因为程序可能从任何地方运行。

0 投票
1 回答
4320 浏览

python - Python平台如何独立?

我知道这Python是独立于平台的,但我不明白它是如何工作的CPython。如果解释器和一些模块是用 编写的C,那么这些不是依赖于平台的吗?

0 投票
0 回答
49 浏览

visual-studio-code - vs code consistent keybindings for Mac and windows with settings sync

I use a windows computer for work and have painstakingly set up many keybindings for common tasks, as well as many other personalizations I really would like to have transferred to my personal computer, which is a Mac.

I recently found out about and set up Settings Sync, which is pretty awesome, but I can't seem to get my keybindings to work quite how I would like.

First, it doesn't seem that any of my keybindings transferred--when I open up the keyboard shortcuts on Mac and display User Keybindings, the list is empty, yet when I do this on Windows, all my keybindings are there.

To complicate matters, I sometimes use a Windows keyboard with my Mac. Without getting into too much detail, I'll explain what I'm trying to accomplish with a particular shortcut:

On windows machine, I use the right alt and ctrl keys to open up my integrated terminal with:

alt+ctrl+t

I'd like to keep this keybinding to work even when on my Mac because when I use my windows keyboard with it, I still have the alt and ctrl keys on the right side of the keyboard.

However, on my Mac without the windows keyboard, in place of the alt and ctrl keys I have the cmd and option keys, so in this instance I'd like cmd+option+t to trigger the integrated terminal.

So, is my solution to simply recreate all my windows shortcuts that use alt+ctrl with a corresponding cmd+opt version for Mac? And what about all the missing user keybindings that didn't seem to transfer with settings sync (logs show that they should've been transferred)? If anyone has any advice about how to properly set this up, I'd greatly appreciate it. Thanks.