16 ms·
<3 Deno
- royletron 4y agoReally nice. I've only seen Deno as something hard to adopt for very little reason but this gives really great reason!
- cokeandpepsi 4y ago[dead]
- revskill 4y agoThat kind of import, means private package is not allowed ? So no more private package in Deno ?
- katsura 4y agoYes, it is allowed: https://deno.land/manual@v1.30.3/basics/modules/private https://deno.land/manual@v1.30.3/basics/modules/private
- revskill 4y agoDoes it have guidance on publishing your own package to github ?
- katsura 4y agoNot specifically for GitHub, but: https://deno.land/manual@v1.30.3/advanced/publishing https://deno.land/manual@v1.30.3/advanced/publishing The point seems to be that it doesn't need anything special, you just import files, and Deno takes care of the rest.
- brundolf 4y agoAs soon as Deno introduced me to the idea of just using URLs for importing dependencies, it immediately felt like obviously the best way Want a private repository? Stand up an apache server. Or an S3 bucket. CDN in front? Sure, why not Want to casually host and not deal with a repository? Import directly from github Namespacing? Domain names. And they already have ownership controls/auth that your ecosystem doesn't then have to reinvent Combine that with import-mapping (being able to tell the runtime to load X when it sees Y), and I don't see any reason to do it any other way
- revskill 4y agoYes, the only requirements/issues as i see, is: - Need a fallback plan if original hosting died ? - Need to specify immutable version/hash for the url ?
- brundolf 4y agoImport maps take care of the first, like I said: https://deno.land/manual@v1.30.3/basics/import_maps https://deno.land/manual@v1.30.3/basics/import_maps And Deno supports lockfiles for the second: https://deno.land/manual@v1.30.3/basics/modules/integrity_checking https://deno.land/manual@v1.30.3/basics/modules/integrity_ch... It also has a vendoring mechanism, if you prefer that approach: https://deno.land/manual@v1.30.3/tools/vendor https://deno.land/manual@v1.30.3/tools/vendor
- revskill 4y agoThen it's cool. Same in Haskell when i could use multiple versions in same module.
- matklad 4y agoOne potentially compelling reason is dependency resolution. You can’t express Cargo-style “collect _requirements_ for all dependencies, and then pick the minimal set of dependencies which satisfies all requirements” with just urls. You potentially can encode fancy constraints for each specific dep into an url, but you can’t have an algorithm which globally looks at the set of dependencies. If you want that use-case, you’ll need some extra tooling which reads constraints and writes the import map. OTOH, it’s not clear if fancy constraints solve more problems than they create. Notably, if the only constraint is `^x.y.z`, than the gready, expressible-via-urls algorithm of always selecting the latest semver-compatible version yields the minimal solution.
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- jamal-kumar 4y agoI tried Deno and really liked it. The pros: - It uses the v8 engine so you've got the same APIs you know and love for the browser like fetch() - Something that nodejs is just catching up to now - It's not nodejs, the whole name means 'destroy node'. You can get a lot done without being buried in dependencies. Well-maintained core libraries. - Server-Side WASM is a really interesting idea for encapsulating and integrating stuff written in, say, C++ The cons: - Some of the third party ecosystem seems to be suffering from a lack of recent maintenance - Server-side WASM is limited to 32-bit until they figure that out, which also limits whatever you do with it to a 4GB memory ceiling Other than all that though it's probably not a bad choice for anyone not bothered by those limitations and just wants everyone who speaks typescript on the frontend to be able to grasp what's on the server side end of things too. I think it could probably thrive with more usage traction.
- jakear 4y agoNode also uses V8, the lack of API parity with browser is unrelated.
- NIckGeek 4y agoNode.JS and Deno are both running with V8. fetch() isn't part of the JS standard library, it's a Web API. Deno just made (the good imo) design decision to support WebAPIs over something more custom despite the fact that it's not a runtime for web apps. Server-side WASM is the future for FaaS imo, sandboxing built in and an effective object-capability approach to dependency safety is amazing.
- Xenoamorphous 4y agofetch is also an API in node (last few versions) https://nodejs.org/dist/latest-v18.x/docs/api/globals.html https://nodejs.org/dist/latest-v18.x/docs/api/globals.html
- pjmlp 4y agoHello Java servlets.
- 4y ago
- lucas_codes 4y agoWhat is wrong with ["10","10","10"].map(parseInt) ?
- contextnavidad 4y agoIt passes the value and index to `parseInt`, where the 2nd argument is `base`. So it does not return `[10, 10, 10]` as you'd expect. It returns `[10, NaN, 2]` instead. You have to do `['10', '10', '10'].map((val) => parseInt(val, 10));` to get the "expected" output. In addition, you should always provide `base` to `parseInt` otherwise it has it's own interpretation infered by the value you give it. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt#parameters https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- vbezhenar 4y agoMy favourite interview question is asking what would return `"192.168.0.1".split(".").map(parseInt)` and why.
- JeremyBanks 4y agoThat seems like a very bad interview question
- vbezhenar 4y agoCan you elaborate why do you think so? I'm not asking for correct answer on this question of course (indeed if candidate would answer correctly it means that he knew the answer and the question had no point). I'm expecting to confuse candidate by providing him correct answer and then ask him to find out why his assumption differs from correct answer. This is common in software development and observing how does one tries to understand wrong code provides valuable insight on his skills. Another question that I like is asking to find out issues in one fragment of code. This fragment is crafted to contain style issues, some bugs and architecture issues. This allows to understand the level of candidate: which issues can he spot. Not ideal, but I think it works good enough.
- katsura 4y agoOne issue that's been bothering me about Deno is this one: https://github.com/denoland/deno/issues/14244 https://github.com/denoland/deno/issues/14244 You have to use a third-party Docker container if you want to use Docker locally and develop on an M1 Mac (I use Docker to separate my different dev environments). And the issue was just ignored and became stale.
- brundolf 4y agoYou don't really need Docker even with Node (because it has good dependency management), and especially with Deno (good built-in tooling too)
- spartanatreyu 4y ago> You don't really need Docker even with Node I'm assuming you've never run into node-gyp issues then?
- brundolf 4y agoIn my experience they're pretty rare. Not many Node packages need a native build (mostly node-sass in my experience, which has now been deprecated in favor of a Dart implementation which I believe compiles to JavaScript), and I don't think Deno even supports importing non-JS/WASM modules to begin with, so that type of problem should be fully impossible here
- spartanatreyu 4y agoI usually see these binary dependencies in node projects: - sass - imagemin-gifsicle - imagemin-jpegtran - imagemin-optipng - imagemin-svgo Deno does support native plugins, so we could see the same thing happen there.
- brundolf 4y agoI think there's still a meaningful difference between runtime plugins (which to my understanding have to exist locally on the file system, outside of normal dependencies) vs normal dependencies that just sometimes have a native component. Deno projects won't occasionally accidentally have a native dependency like Node projects do; adding one will be a Big Deal that you choose to do on purpose, probably reserved for extreme cases, and for those special cases maybe you also choose to bail out and use Docker
- auggierose 4y agoI don't know, Deno seems to be a solution looking for a problem. For example, the built-in bundle command works for Deno, and "might" only work for the web, other solutions as esbuild are recommended instead.
- mark_and_sweep 4y ago> Deno seems to be a solution looking for a problem On the contrary. Ryan Dahl, the person who created node, came up with deno, specifically to address a number of problems (or regrets) he had with node: see https://youtu.be/M3BM9TB-8yA https://youtu.be/M3BM9TB-8yA.
- auggierose 4y agoYes, I know that. But Dahl's regrets are not my problems, really. Remember that Dahl is NOT the author of npm, and without npm, where would Node be now? Probably nowhere. For example, what is the problem with calling the TypeScript compiler? I have a build setup anyway, so why does it need to be integrated? That's an example of a solution where I don't see the problem.
- mark_and_sweep 4y ago> without npm, where would Node be now? Probably nowhere. I disagree. There were and still are good competing package managers and registries. Perhaps, in an alternate universe, yarn might have won. Or in yet another universe, node would have package management built-in, as deno does now. In any case, node would be fine. > what is the problem with calling the TypeScript compiler? I have a build setup anyway Just because your project has a build setup, doesn't mean all other projects must have one, too...
- auggierose 4y agoNo, projects can do what they want, but if having a build setup is your biggest problem you need to solve, you are pretty lucky. Anyway, my real problem is to be able to easily create modules that I can use everywhere, on the backend, and in the browser. I don't think Deno makes that easier than Node, because for the web, I still need to add a build step using esbuild. So for me, Deno is pretty pointless. But that's just my opinion.
- obblekk 4y agoInteresting to see a different side to the benefits of Deno. Personally, I find direct Typescript interpretation to be one of the best features. Typescript is not necessarily a simple type system, but it is an expressive one: - It has great type inference avoiding Java style codespam - It has gradual typing, enabling "risky" type casts - It has fully functional types, enabling the productivity and readability improvements from functions as data - It is 10 seconds away from having dependent types Typescript took most of the best programming language research from the past 20 years and popularized it in a way that actually makes js hackers more productive without getting too much in the way. The only hard thing has been that js interpreters don't understand typescript, requiring an awkward transpilation step with weird symlinks and other hidden complexity that works 99% of the time, but wastes a lot of time when it doesn't work just right. If Deno could just solve that, it would be a great improvement. If it's also faster (as claimed) that's even better. This article shows a lot of other ways in which small, simple improvements add up to a much better product. Can't wait until it's production ready.
- SOLAR_FIELDS 4y agoIt’s hard to beat a pedigree like Anders’ for Typescript. He had Delphi and C# to cut his teeth on. I can’t imagine many other people that would be better qualified to design something pragmatic on top of the ugliness of JavaScript
- sabellito 4y agoThat's very true. I see other programming languages trying to add/enhance types now (ruby, python, go to some extent), and not having a beast like Anders on the team must make it tough to ship an amazing type system.
- SOLAR_FIELDS 4y agoI feel like pedigrees are somewhat underrated in software engineering. Everywhere I go there always seems to be some sort of egotistical “I can make the best thing”
- askonomm 4y agoI recently built a full-stack app with Deno (and their Fresh framework https://fresh.deno.dev https://fresh.deno.dev) called Invo (https://invo.ee https://invo.ee) and the whole experience was delightful. I was able to move really fast and I never had to touch a configuration file, which also immensely helped with my motivation of actually building something - far too often I get stuck in a pile of config (I do Clojure mostly) and lose any motivation I had.
- stoicjumbotron 4y agoCan you mention your complete tech stack?
- askonomm 4y agoDeveloped using Fresh framework (https://fresh.deno.dev https://fresh.deno.dev) and deployed to Deno Deploy (https://deno.com/deploy https://deno.com/deploy). For persistent storage I use a simple MySQL instance from DigitalOcean (https://www.digitalocean.com/products/managed-databases https://www.digitalocean.com/products/managed-databases). The PDF creation is done via Browserless (https://www.browserless.io/ https://www.browserless.io/), which really just captures a website I point it towards and creates a PDF out of it.
- viginti_tres 4y agoJust wanted to notify that your app doesn't work. I downloaded the invoice but it shows `404 Not Found The requested deployment does not exist. code: DEPLOYMENT_NOT_FOUND`
- deleted 4y ago[deleted]
- askonomm 4y agoThanks for mentioning! Fixed now.
- nrichardson 4y ago
- ergocoder 4y agoFun fact: I remember when I was at Google in 2017. Ryan Dahl was there as well as a junior engineer (L4). L4 typically are engineers who graduated for 1-2 years. Meanwhile Ryan has built a programming engine that has been used worldwide and widely popular on the same scale of Ruby, Java, Python... But he was slotted as an L4.
- steveklabnik 4y agoI interviewed at Google pre-pandemic, and they wanted me to start at an L4 as well.
- heavyset_go 4y agoThat's nuts, what was their reasoning?
- steveklabnik 4y agoI don’t want to particularly get into all of it at this moment, as there were a lot of weird moving parts. In the end Cloudflare gave me a very straightforward process and a better offer, so I ended things with Google post in-person-interview but pre actually extending me an offer. What I will say is that from what I hear this sort of under-leveling is pretty normal and just how it is. Maybe it’s better now, I don’t know.
- myko 4y agoDoesn't seem better now. Maybe certain teams do better? Seems rampant.
- syndacks 4y agoYou got trolled
- operatingthetan 4y agoThey're clearly incentivized to underlevel people and then take whatever they can get who accepts, so how is it a troll if it's business as usual?
- Yahivin 4y agoStill waiting on https://github.com/denoland/deno/issues/1739 https://github.com/denoland/deno/issues/1739
- epolanski 4y agoAfter reading this, if anything, it made me appreciate containers more.
- contextnavidad 4y agoIt's great to see other JS runtimes progressing, I have a continued frustration with the lack of decent TS tooling and ESM support in Node.js. Jest and Mocha both do not support ESM very well out of the box and there is an expectation that you are using babel to transpile to CommonJS for everything to work nicely. (See Jest's _experimental_ support for ESM mocking!). Node.js is only starting to build out a testing framework, and it has a way to go yet until it has any level of feature parity with the established libraries. Then you have the naive assumption that any package written in JS works with TS. Which is true, they do work, but the missing types will always lead you to look for a TS-first alternative. A good example of this is Joi vs Zod for validation, with the latter performing type inference based on your validation parameters, which is great. But it really does feel like you have a subset of a package ecoystem lurking on NPM. I am not that confident Deno is the answer, but I would say those are my biggest frustration writing production grade JS/TS code today.
- denysonique 4y agoHave a look at https://github.com/esbuild-kit/tsx https://github.com/esbuild-kit/tsx tsx is a CLI command (alternative to node) for seamlessly running TypeScript & ESM, in both commonjs & module package types. It's powered by esbuild so it's insanely fast. I also suggest using its alias: esno
- ovao 4y agoOne particularly nice aspect to Deno is its built-in test runner. There’s no complex configuration, like grabbing ts-jest, setting up your transform filters, ensuring that you’re injecting `@jest/types` and then almost invariably spending time debugging precisely why it still can’t grok an export keyword. The Node testing ecosystem has its obvious advantages in terms of how much it’s been buttressed by third-party efforts (which makes it incredibly flexible), but just being able to write a TypeScript test file, run `deno test` and just have it work is really a breath of fresh air.
- johnny22 4y agonode has a built in test runner too, but i've not used it yet.
- iterm2 4y agoSeems like going in to more of a .NET land....
- 1vuio0pswjnm7 4y agoI would like Deno or Bun to be easier to compile than Firefox or Chromium: Less resource-intensive. Less CPU, less memory, less storage space and less time required to compile. The present: Use an enormous, complex, sometimes closed source, omnibus program containing a Javascript engine to remotely source and run Javascript files, i.e., other peoples' programs, listed in webpages (sometimes cascades of them as dependencies) in a way that is non-transparent to the user, allowing selected access to certain features of the the user's computer, all mediated and controlled by Big Tech with its dependence on advertising and associated data collection and surveilllance and conflict of interest with respect to users. The future: Use a standalone Javascript engine to remotely source and run other peoples' Javascript programs in a way that is transparent to the end-user, with all access to the user's computer, if any, under the full control of the user, with no dependence on advertising and no need for data collection and surveillance. "Javascript" might be replaced with some other language. Typescript, WASM, whatever. In the earlier days of the web before Javascript, people tried to use "Java applets". Back in those days when an applet was encountered the browser would ask the user for permission to run it. As I remember it, this was about as annoying as cookie permission popups, another idea that was implemented in the earlier web then disappeared, but has now been re-implemented due to emrging privacy laws.
- TylerE 4y agoIsn’t the JavaScript runtime the largest single component in a browser? Is there really that much fat to trim?
- deleted 4y ago[deleted]
- anon291 4y agoA lot of complexity in computer science stems from duplicating functionality due to developers not wanting to learn the best tools. The best tool when it comes to implicit dependencies are nix/guix. These have solved the issue across languages for almost two decades. Unfortunately, they have a reputation of being 'hard', so instead of someone attempting another try at the actual problem (cross language implicit dependencies), what we have here is yet another javascript runtime that 'solves' this problem, but only if you're using javascript. Deno sounds well thought out, but the article realistically presented no compelling reason to try it. And realistically, it presented many reasons not to. Javascript is a horrendous language. Not because of the syntax, not because of the library support, but simply because even self-dubbed javascript 'experts' are often confuddled by its standardized behavior. We could probably count on several fingers the number of people who can accurately describe javascript's semantics. As the rest of the computing world moves towards sane languages, this seems like backwards 'progress'.
- bbkane 4y agoThe reason to try it that I took away was that it's easy to install and then you get all these niceties - LSP, formatter, scripts, with no extra effort! I love that!!!
- anon291 4y agoNix flake init does this for just about any language.
- mplanchard 4y agoAh and yet nix itself does not yet have a particularly useful language server, to my knowledge
- spartanatreyu 4y agoNix still has issues with things going out of date / falling out of support. One of the good points about deno raised in the article is that deno removes that problem by having first-party solutions to things that developers usually need built-in. Also while JS has plenty of footguns, Deno being built around TS and deno ts developers using eslint as a standard practice eliminates those footguns.
- rubenfiszel 4y agoI love deno so much and all of its ideas highlighted in the article (dependency management, security, performance) so much that I've build an entire framework around making scripting enterprise grade that is centered around deno support. The project is open-source [1], we even expose a web monaco editor and made the lsp support available using websocket and json-rpc. The goal here is to build enterprise-grade one-off script and workflows in deno, that can benefit from permissioned credentials, autogenerated UI (by parsing the main function parameters), a workflow engine similar to airflow/temporal, etc ... We have a hub [2], centered around deno, that serves as our library of integration. An integration for us, is just a script that uses the right dependency to do an atomic action like fetching data or doing a POST. We are betting big on deno, and are hoping with windmill to be the framework to make it enterprise-ready for other things than webservers (which most of the deno framework currently focus on). [1]: https://github.com/windmill-labs/windmill https://github.com/windmill-labs/windmill [2]: https://hub.windmill.dev https://hub.windmill.dev
- jhot 4y agoJust wanted to say I bookmarked windmill a couple weeks ago and am really excited to try it out.
- Kinrany 4y agoWhile trying to use the public instance, finding created scripts was kinda hard: they're under "Home". When a script is being viewed, "Home" is not highlighted, and it seems like one of the last places to check. Also, starting with an empty workspace and importing examples from the hub manually might be less confusing. With public workspace having all these examples, "Home" is cluttered and it's not obvious that new scripts also end up there. Overall it's very impressive, thanks for open sourcing!
- maxs 4y agoVery cool project, I bookmarked it as well and excited to try.
- zengid 4y ago> The only big drawback of Deno is the language Ooft. Although TypeScript does have a bit of a learning curve, and a lot of gotchas, I still have to say it's my favorite language to use. If you combine the delicious syntax-sugar of ES6 (and beyond) with a sprinkling of tasteful types, the language leaves you full and energized without feeling bloated.
- brigandish 4y agoWhat are you comparing it to and what is lacking in those other languages?
- zengid 4y agoGood question. To be fair, JavaScript was my first "real" programming language, so my brain has adapted the most to it's weirdness. That's probably why TypeScript is very useful for me. But to answer your question, I've been using C# primarily for the last 4 years, and I dabble in other languages like Rust and Python. I used C++ in school (that's what they used for programming classes if you'll believe it). TypeScript feels pretty nice, but I do adore C#. I wish Microsoft would make a T# (as someone else put it once).
- AlchemistCamp 4y agoTypeScript’s type system is very complex and yet fails to achieve type safety to the degree that really strict languages do. I’m not that into class-based languages and prefer a language to have macros (more for DSLs they enable them for application code). However, even if those preferences were off the table, I’d still rather have something like Kotlin on the server than TS. It’s simpler and isn’t weighed down by 30 years of cruft.
- spartanatreyu 4y agoTypescript isn't really a class-based language. It's a language that supports both function and OO paradigms. Also, if macros/DSLs are what you're after, then you'd probably be interested in typescript's decorators. (you can use the old experimental decorators based on the old standard from ages past, and the new *standard* decorators introduced in typescript 5 which are based on the current stage-3 ecmascript proposal). The only things typescript as a language is really lacking are: 1. Pattern matching (minor issue) - +90% of pattern matching is really just a more concise switch/case syntax - the remaining -10% can be done by hand with mapping or just basic if statements 2. Immutable data-structures (minor issue) - The `as const` suffix handles most of the use cases. - There is a Records/Tuples proposal which would give some better syntactic sugar and some run-time performance improvements too. 3. Trait system (minor issue) - Typescript compiles down to Javascript which at the lowest level is actually a prototype-based language. Traits can be approximated using run-time mixins which alter the prototypes to essentially perform the same functions as traits. - But, it would be nice to have compile-time rather than run-time support for traits. - I think most languages are still only coming to terms with the fact that traits are often better than "traditional OOP classes". 4. Effects system (investigate) - It's too early to tell, but having an effects system (à la OCAML 5) will probably lead to entirely new programming paradigms. I'm not sure where it will lead, but having native algebraic effects to replace try/catch/throw would be very nice. Edit: Formatting
- stephc_int13 4y agoI fully agree with the author here. The good old Unix philosophy of designing simple tools that are doing only one thing right has proven extremely useful in the context of using the Shell as a scripting interface. Composability is paramount to be able to glue small cogs together to quickly build a larger machine for ones needs. But this way of thinking should not apply to everything, especially not when the tool itself is designed to be used a direct interface with the user (like a Shell).
- cjbprime 4y agoTried out Deno recently! Having a super powerful REPL is really important to me, so I was trying chrome://inspect connecting to Deno. But I guess that when you do this, you have a JS REPL rather than a TS REPL, is that right? What do people usually do for that?
- brundolf 4y agoI can't think of a situation where I'd need my repl to be statically typed, since it's for disposable code; I'm not even sure I would want it to be. Did you have a case where that would be helpful?
- cjbprime 4y agoI suppose step one might be "being able to paste some TypeScript code without generating syntax errors"? But it'd be interesting to see extra completion options or type errors surfaced, possibly even asynchronously after you've already run the code, letting you know about a mistake you might be making in your disposable code.
- brundolf 4y agoThat's fair, I could see that
- lordgroff 4y agoI've recently been playing with Deno. It's early days yet but for all the general scripting tasks I might use Python for, I find Deno a better fit. First class typescript is a killer feature, as is the fact that there is a semblance of stdlib which node simply doesn't have. My two main quibbles about Deno are: 1. The rather pointless security model that seems about as relevant as it did for PowerShell. 2. It's quite young, there's still some pointy edges.
- fijiaarone 4y agoThe whole point of deno is that you can’t use it for general scripting without jumping through a bunch of hoops and then it isn’t portable.
- cal85 4y agoWhat hoops? I am using it for general scripting and very happy with it.
- jrvarela56 4y ago> ["10", "10", "10"].map(parseInt) [ 10, NaN, 2 ] what... the... fuck... I have seen the WAT video but forgot about this example.
- ironmagma 4y agoNot that surprising when you remember that map and parseInt both deal with more than one argument.
- PoignardAzur 4y agoThat example isn't in the WAT video (I just re-watched it).
- pohl 4y agoIt would have been a pretty long talk if they had included all the WAT
- fijiaarone 4y agoMaking things harder for developers “because it’s better for them” rarely works out.
- crispinb 4y agoAs a frequent js/ts avoider currently using deno and deno deploy for a few bits and pieces, I've found both truly pleasant to use. My needs are simple (cut to fit my js ecosystem ignorance) but given those limits, the only problems I've had so far are with some npm deps that don't work (&/or I don't know how to make work). No big issue as there's often some deno-proper equivalent, or if not, some other npm package that's OK. Usually when I do anything in the node/npm world I have to steel myself. But Deno & Deno deploy are actually fun.
- mark_and_sweep 4y agoAgreed. Deno Deploy is actually a great product. I'm using it for all of my side projects now.
- vbezhenar 4y agoDeno is awesome but I'm not satisfied with implementation. I wrote very simple web server which listens for GitHub CI notifications (with deno I implemented it all including crypto with 0 dependencies, wow). We're tiny company so notifications are like once an hour or something like that. It eats like 50 MB of RAM and eats like 6m CPU all the time. Simple Go server eats around 20-30 MB of RAM and eats < 1m CPU all the time. I just don't understand what does deno do all the time with its 6m idle CPU. Hopefully it'll be improved in the future. Also I think this whole granular access thing is weird. I never wanted it, container isolation is more than enough. Hopefully it does not add much drag to deno progress.
- lytedev 4y agoDeno packs a lot in and V8 is pretty big to begin with. It makes sense to me that a Go binary will be leaner in pretty much every metric than a Deno script. I think the win with Deno is the JS ecosystem and the situations where JSs dynamicity is an advantage. Sometimes (often times, in my own estimates) that's worth double the memory usage and 20% the raw CPU performance.
- Sophistifunk 4y agoIt's a step in a positive direction that Deno makes you explicitly grant a script permission to do some things, but that's not at all what is meant by capabilities, and that's absolutely the wrong word to use to describe it. A capability is a first-class concept that exists at runtime, and is a value you must pass to dependencies that need it. You should also be able to use it to create new, dependent capabilities with fewer rights, and they should in general be much finer-grained than "can access the internet" to be of real use.
- schemescape 4y ago> they should in general be much finer-grained than "can access the internet" Just for the record, Deno does allow finer grained control than that: > --allow-net=<allow-net> Allow network access. You can specify an optional, comma-separated list of IP addresses or hostnames (optionally with ports) to provide an allow-list of allowed network addresses. https://deno.land/manual@v1.30.3/basics/permissions https://deno.land/manual@v1.30.3/basics/permissions
- continuational 4y agoAgreed - the Deno model doesn't bring much security, because you have to grant all code in the whole app the same permissions, which for any non-trivial app will amount to "mostly everything". First class capabilities are a much better approach, a real solution to supply chain attacks.
- vorticalbox 4y agoSure but things like web access you can grant access to just the domains your app uses and everything else is blocked same for file access you can grant is access to "views". Though most people will likely just --allow-all because it is easy.
- hayd 4y agoFor now. Realms will address this.
- matklad 4y ago
- iamgopal 4y agofresh.deno.dev reviews ?
- vipull 4y ago[dead]
- fulafel 4y agoWhat Deno features are tied to TS? Can you eg use the "vendor" feature (or hook it) if you wanted to use it with other languages that compile to JS or Wasm, like ClojureScript or Rust?
- haburka 4y agoDefinitely this is a weird take to me because most web developers just use a Mac and then setting up an environment is fairly easy with brew and nvm. I haven’t tried but I imagine linux is also pretty straightforward. If you’re doing web dev on Windows I think it would behoove you to use WSL rather than mess around with the weirdness around path limits and the like. However, the security issues are valid but not necessarily an issue solved by the framework. Ultimately some kind of package manager that had a manual review step before packages could go out would be a nice step, and would work at scale as well. Manually listing permissions for an application works for security until people get tired, or are just so used to saying yes. Its also very bold of deno to assume their sandbox is impossible to escape. It’s much more likely that no one cares to really try.
- mark_and_sweep 4y agoNo, most web devs use Windows: https://fossbytes.com/windows-still-the-leading-os-for-software-development-followed-by-linux/ https://fossbytes.com/windows-still-the-leading-os-for-softw...
- singularity2001 4y agoI'd love them if they fixed the import require module mess
- kytazo 4y agoLooks great, I just hope they get to release an arm64 version for linux soon as well.
- niedzielski 4y agoI'm a big Deno fan and use it whenever I can. I think tasks are great and they solve the most common needs. In my experience, however, as soon as my tasks section got large enough that a separate file was needed, it became long-running enough that I wanted a generic file dependency-aware builds which required a make-like solution. What should large projects do that need to build assets or perform long-running work as part of a build process without dipping into another clunky tool? I have similar issues with threading development-only import maps that reference local modules in a polyrepo during development and sharing common Deno configs. Customization doesn't scale well to task one-liners even though I want it to. Do folks know of open-source polyrepo reference that serve as a paradigm for patterns that scale?
- mlw-at-rme 4y agoDeno #_#
- timdaub 4y agothis was an interesting read, although the beginning was a bit confusing. I laughed a little when I saw the author hinting at TS creating complex structures. A reason I never adopted it. A great use of TS would be to type the external interfaces though!
- camgunz 4y agoThis argument is so interesting, essentially it's "there is no other Deno, so you don't have to worry about using a slightly incompatible implementation and getting bugs". But a lot of people think that multiple implementations and specs are good things (I personally don't know which way I go on this one). And thinking about it, I kind of don't buy the argument. There are specs for JavaScript and TypeScript, and multiple standalone JS and TS engines: node, QuickJS, duckjs, Bun, etc. I also don't buy the "minimal, practical" take on dependency management. It sounds like they just built a package manager into Deno itself and put versions in the URL, which feels like the opposite of minimal and more like "batteries included". Again not saying this is bad--the Python ecosystem suffers pretty badly from not having their dependency story totally mapped out--just quibbling over the characterization. On the other hand, I do buy the security thing. AFAIK this is the first scripting runtime to essentially integrate pledge [0], which is real interesting. [0]: https://man.openbsd.org/pledge.2 https://man.openbsd.org/pledge.2
- andyferris 4y agoMy take is that Deno borrows a lot from web standards and functionality provided accross browsers. In the case of dependency management, they use a pattern which would also work for client code shipped to a web browser (in that case the client would assemble the code - like if you had a reference to load mathjax or google analytics or whatever, or you could alternatively vendor and ship them yourself). To me Deno is basically modern web standards + very nice tooling for use as a scripting or serverside language (typescript interpretter, format, compile, vendor, test, lockfiles/import maps, ability to explicitly include/exclude capabilties from runtime, etc).
- patates 4y agoFrom all of the quirks JS has, I think ["10", "10", "10"].map(parseInt) is the sanest. Taken in isolation, the parameters of both Array.prototype.map and parseInt makes sense, and a typed language wouldn't help there too much. All hope is on ESLint rules to not let you do shortcuts which could burn you.
- danbruc 4y ago[...] and a typed language wouldn't help there too much. That would be impossible in a typed language. The argument of map() is supposed to be a function with signature (T, Integer, T[]) -> R and parseInt() has signature (String, Integer) -> Integer.
- patates 4y agoYeah the third parameter would by chance save the situation here but it's not a rule that you'd always be protected. Also it would be perfectly fine to cast parseInt to (String, Integer, _) in a sufficiently smart type system.
- danbruc 4y agoThe third parameter, I would argue, is a bit wired to begin with. If you need the entire collection, then you are probably doing more than map(), and if you really need it, then you could probably just close over it. But with that somewhat wired third parameter removed, you are right, that is something you could easily run into in a typed language.
- berry_sortoro 4y ago[dead]
- apatheticonion 4y agoAt this point, I would love to see a compiler for a strict subset of TypeScript with a threading model similar to that of Go. The biggest thing holding back TypeScript is the awkward transpilation dance, a weak standard library in Node and relatively poor performance - none of which are the fault of the language. Break free TypeScript, you gotta move out of your parents' place eventually
- flohofwoe 4y agoAssemblyScript is a bit like that: https://www.assemblyscript.org/ https://www.assemblyscript.org/ But it goes into a slightly different direction from what you want (the main motivation was a "stripped down TS for WASM", not a "stripped down TS with go routines"). It will be interesting to see how they'll tackle multithreading (now that WASM threading is out in the wild).
- pjmlp 4y agoMicrosoft has a native compiler for a Typescript subset on their MakeCode IoT project.
- azangru 4y ago> Deno comes with a built in deno vendor command, which fetches all of the dependencies of the current project and puts them into a subfolder, making production deployments immune to dependencies’ hosting failures. While this is certainly nice, should third-party code be actually committed in your version control system? I always treated it like a bad idea. Adding node_modules to gitignore is second nature now.
- rlio 4y agoIf you work a company with a large monorepo, you often want to vendor all third party dependencies in the tree — you don’t want the build of this massive repo to be down because one of the five package managers it depends on is down. And if there’s a single vendor folder used by all projects, you’re certain that all parts of the tree are using the same version of the external dependency.
- conaclos 4y ago> post ES6 [...] has some really good parts, like injection-proof template literal semantics. What is injection-proof template literal? Any link about that? Thanks :)
- matklad 4y agohttps://julialang.org/blog/2013/04/put-this-in-your-pipe/#do-nothing_backticks https://julialang.org/blog/2013/04/put-this-in-your-pipe/#do... for what is this abstractly and why that is needed. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... for specific implementation in JS. Compare with f-strings in Python, which are superficially similar, but can’t be used to, eg, construct SQL or HTML not prone to injection attacks.
- conaclos 4y agoOne of the frustrating thing with npm-scripts is the mandatory one-liner script. It is not possible to write a script on several lines. I would really appreciate if deno-task-shell could be used in a shebang for writing scripts that expands on several lines in dedicated files.
- garfieldnate 4y agoAs usual, a bit of a love-hate relationship with TypeScript. What TS has done to JS, though, is absolutely incredible. I wonder if it's possible to abstract the engine, somehow, and apply it on top of a new language. I would love TS without all the warts of JS.