Macil@programming.devtoProgramming@programming.dev•Are there contemporary programming languages that do *NOT* have the ability to import functions or values or whatever from other files? Are there situations in which that would be a feature?English
1·
1 year agoDeno is an example of a language runtime (based on Javascript+Typescript) that’s been built with capabilities in mind. By default, programs aren’t allowed to touch the filesystem or network (except to allow static imports to run; fallible dynamic import calls that could be used to determine something about the filesystem or network are restricted like other IO). Programs can start up worker threads that have further permission restrictions than the main program.
React works well in this role too because it supports SSR. This part seems to assume that React SSR is inferior to other classic backend HTML SSR solutions, which is not my experience. Even for static non-interactive content, the way React has you organize your code into components is a much better setup than most classic HTML template systems I’ve used. And then React makes it very easy to sprinkle in interactivity where you want, without requiring you to bridge unrelated server-side html templates and front-end code (which can often blow up in complexity and require work to be re-done separately on each side of the codebase). The same React components can be used in server-side rendering and client-side code, so whenever some new page interactivity requires the client to render something that was previously only server-side rendered, you don’t need to rewrite the component’s code in a new system and maintain two versions of it.