Who Am I?

Nirmal Vyas

16+ years experience in IT field

Worked almost 10+ years in various IT companies as a Developer, Senior developer, Team lead, Project Manager etc.

Fulltime Freelancer/Consultant since last 6 + years
I do Web development projects for various clients in India and abroad, and also Technical Consultancy Services for various IT companies and startups including Brototype.
 

Website: http://codenirmal.com/

 

Organizer of Technical meetups in Kochi like Kerala JS, Active Member of other groups like Kochi Ruby, Kochi Python etc. 

Brief History of JavaScript Runtimes: Node.js and the Emergence of Deno

Early Days of JavaScript (1995-2009)

Early Days of JavaScript (1995-2009)

  • JavaScript Origin:
    • JavaScript was created in 1995 by Brendan Eich at Netscape as a language to bring interactivity to web pages.
    • It was initially designed to run in the browser, making it a client-side language.
  • Limitation:
    • In the early days, JavaScript could only be executed inside the browser. Developers didn’t have a way to use it for building server-side applications or scripts running on a machine.

 The Birth of Node.js (2009)



 

  • The Problem:
    • Around the mid-2000s, the server-side development landscape was dominated by languages like PHP, Ruby, Python, and Java. JavaScript was only seen as a "frontend" language.
  • Ryan Dahl’s Innovation:
    • In 2009, Ryan Dahl, a developer with a background in distributed systems, introduced Node.js.
    • Key Insight: He recognized the power of Google’s V8 JavaScript engine (used in the Chrome browser) and realized it could be extended to run JavaScript outside the browser.
    • Node.js was built to execute JavaScript on the server, opening up new possibilities for JavaScript as a full-stack language.

Key Features of Node.js



 

  • Non-Blocking I/O:
    • Unlike traditional server environments, Node.js introduced an event-driven, non-blocking I/O model, which allowed for handling multiple requests simultaneously without the need for multiple threads.
  • JavaScript Everywhere:
    • Node.js enabled developers to use JavaScript both on the frontend and backend, leading to full-stack JavaScript applications.
  • NPM (Node Package Manager):
    • One of the major innovations of Node.js was the creation of NPM, a robust ecosystem of reusable packages, which rapidly grew and became one of the largest package repositories in the world.

Node.js’s Impact and Adoption
 

  • Widespread Adoption:
    • Node.js revolutionized web development, quickly gaining popularity among developers for its speed, efficiency, and scalability.
       
    • Major companies like Netflix, PayPal, LinkedIn, and Walmart adopted Node.js for server-side operations, and it became the foundation for building scalable, real-time applications.
       
  • Community and Ecosystem:
    • With NPM and a strong open-source community, Node.js became one of the most popular tools for backend development. Thousands of libraries and frameworks (like Express.js) were built on top of Node.js, making it easier to build web applications.

Node.js Limitations

  • Security Concerns:
    • Node.js gave full access to the file system, network, and environment variables by default, raising potential security risks.
  • Callback Hell:
    • The heavy reliance on asynchronous programming and callbacks led to complex, difficult-to-read code known as "callback hell" (though this was later mitigated by the introduction of Promises and async/await).
  • Dependency Management:
    • The NPM ecosystem became so large that managing dependencies could become difficult, leading to "dependency hell" where projects had hundreds or even thousands of indirect dependencies.

The Birth of Deno (2020)







  • Ryan Dahl’s Reflection:
    • Over a decade after creating Node.js, Ryan Dahl identified several regrets and design flaws in Node.js, such as security issues, package management, and the lack of TypeScript support.
    • In 2018, Dahl announced he was working on a new JavaScript runtime, Deno, with the goal of solving some of the issues he faced with Node.js.
  • Official Release:
    • Deno was officially released in May 2020 as a secure and modern runtime for JavaScript and TypeScript.

Key Features of Deno





 

  • Secure by Default:
    • Unlike Node.js, which gives full access to the system, Deno operates with security in mind. By default, Deno has no access to files, network, or environment variables unless explicitly granted.
  • TypeScript Support Out of the Box:
    • Deno natively supports TypeScript, removing the need for additional configuration or build tools. Developers can run TypeScript directly without compiling it first.
  • URL-Based Module Imports:
    • Instead of relying on a centralized package manager like NPM, Deno uses a module system where packages are imported directly from URLs, reducing the need for package.json files and complex dependency trees.


Key Features of Deno







 

  • Built-in Tools:
    • Deno comes with built-in utilities like a formatter, linter, and test runner, which are common needs in any development environment. This simplifies the developer workflow.
  • Single Executable:
    • Unlike Node.js, which relies on multiple external tools and files (such as NPM), Deno is distributed as a single executable, making it simpler to install and use.

Deno's Growing Popularity





 

  • Emerging Ecosystem:
    • Although smaller than Node.js, Deno's ecosystem is rapidly growing, with developers embracing its modern features.
  • Adoption for New Projects:
    • Deno is seen as a great choice for new projects, especially where security and modern tooling (like TypeScript) are important from the outset.
  • Compatibility with Node.js:
    • Deno offers some compatibility with Node.js packages through its standard library, but it’s still growing compared to the massive Node.js ecosystem.

Similarities Between Node.js and Deno

  • JavaScript and TypeScript Support:
    • Both Node.js and Deno allow developers to run JavaScript code on the server, leveraging the power of JavaScript’s non-blocking, asynchronous nature.
    • While Node.js has always been focused on JavaScript, Deno goes further by including native TypeScript support out of the box.
  • Built on V8 Engine:
    • Both runtimes are powered by Google’s V8 engine, the same engine that powers the Chrome browser. This provides both runtimes with high performance, fast execution of JavaScript code, and excellent optimization.
  • Event-Driven Architecture:
    • Both Node.js and Deno use an event-driven architecture with a non-blocking I/O model, making them highly efficient for handling asynchronous tasks like network requests, file operations, or database queries.
  • Server-Side JavaScript:
    • Both runtimes empower developers to write full-stack JavaScript applications. With Node.js and Deno, JavaScript can be used on both the client and server sides, promoting a unified development approach.

 Key Differences Between Node.js and Deno

1.Security Model
  • Node.js:
    • Full Access by Default:
      • Node.js has no restrictions on file system, network, or environment access. It allows developers to access the local machine and its resources without needing special permissions.
    • Security Challenges:
      • This default behavior opens the possibility of security vulnerabilities if developers don't handle permissions properly.
  • Deno:
    • Secure by Default:
      • Deno was built with security as a priority. By default, it denies access to the file system, network, or environment variables.
      • Developers must explicitly enable permissions (e.g., --allow-net, --allow-read), making Deno applications more secure by default.
    • Why This Excites Developers:
      • With Deno, developers don't need to worry about unintended security vulnerabilities due to unregulated system access, which is especially useful in production environment
2. Native TypeScript Support
  • Node.js:
    • External TypeScript Setup:
      • Node.js was originally designed for JavaScript and has no built-in support for TypeScript. Developers must use external tools like ts-node or compile TypeScript into JavaScript using Babel or TypeScript compilers.
  • Deno:
    • First-Class TypeScript Support:
      • Deno was designed with TypeScript in mind, providing native TypeScript support without the need for extra configuration. Developers can write TypeScript directly and execute it with Deno.
    • Why This Excites Developers:
      • TypeScript’s popularity is growing due to its ability to catch errors during development. Deno’s native TypeScript support simplifies the development process by removing the need for separate build steps or configuration.
3. Module System
  • Node.js:
    • NPM and package.json:
      • Node.js relies heavily on the NPM (Node Package Manager) ecosystem for managing third-party libraries and dependencies. Dependencies are tracked through the package.json file, and NPM installs them locally to node_modules.
    • Centralized Ecosystem:
      • NPM is the largest package registry in the world, providing Node.js access to a vast collection of reusable libraries and frameworks.
  • Deno:
    • URL-Based Modules:
      • Deno doesn’t use a centralized package manager like NPM. Instead, modules in Deno are imported using URLs (e.g., import { serve } from "https://deno.land/std/http/server.ts";).
      • Modules are cached locally, and no node_modules or package.json is required.3
4. Tooling and Built-In Utilities



 
  • Node.js:
    • Third-Party Tools:
      • Node.js relies on third-party tools for testing, linting, formatting, etc. Developers need to install tools like ESLint, Prettier, or Jest for different tasks.
  • Deno:
    • Built-In Tooling:
      • Deno comes with a set of built-in utilities such as a test runner, linter, and formatter, reducing the need for extra configuration.
    • Why This Excites Developers:
      • Having built-in tools simplifies the setup process, allows for consistency across projects, and eliminates the overhead of configuring and maintaining external tools.
5. Dependency Management
  • Node.js:
    • Dependency Hell:
      • Node.js projects can sometimes have large and complex dependency trees, leading to situations where many indirect dependencies are installed (e.g., hundreds or thousands of packages in node_modules).
  • Deno:
    • Simpler Dependency Management:
      • By using URL-based imports and caching them locally, Deno eliminates the need for bulky node_modules directories.
    • Why This Excites Developers:
      • This results in more lightweight projects and fewer issues related to dependency management, making Deno projects easier to maintain.

Key Reasons Behind Building Deno

  • Security Concerns

  • Native TypeScript Support

  • Modernizing the Module System

  • Cleaner API Design

  • Built-In Tools

Questions?

nirmalkamath@gmail.com
Whatsapp: 9895625954

  1. KeralaJS meetup September 2014 Ndimensionz Solutions Pvt. Ltd.
  2. KeralaJS meetup August 2017 Vividreal Solutions
  3. KeralaJS meetup September 2017 Fullcontact Technologies
  4. Keralajs October 2017 meetup Hatio Innovations Pvt. Ltd.
  5. OperSource Kerala 2017 - School of Engineering, CUSAT
  6. Keralajs January 2018 - Red Panthers Software Solutions Pvt. Ltd.
  7. Keralajs  March 2018 - Webcastle Media Pvt. Ltd.
  8. Keralajs April 2018 - Webcastle Media Pvt. Ltd.
  9. Keralajs September 2018 - Smacon Technologies Pvt. Ltd.
  10. Keralajs January 2019 - Suyati Technologies
  11. KeralaJS February 2019 - Ignitho Technologies
  12. KeralaJS September 2019 - KeyValue Systems Pvt. Ltd
  13. KeralaJS June 2022 - Hatio Innovations Pvt. Ltd.
  14. KeralaJS July 2022 -  Brototype, Carnival Infopark, Kochi
  15. KeralaJS August 2022 - Metric Tree labs
  16. KeralaJS January 2023 - Tinkerspace By TinkerHub
  17. KeralaJS March 2023 - BigBinary
  18. KeralaJS June 2023 - Brototype, Calicut
  19. KeralaJS July 2023 - Brototype, Kochi

 

10 years of KeralaJS

Official telegram Group: t.me/keralaJS

Made with Slides.com