Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Atom Editor: written in JS

Atom Editor: written in JS

Scheduled Pinned Locked Moved The Lounge
javascriptcomdata-structures
9 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    raddevus
    wrote on last edited by
    #1

    Examining the open source Atom editor. It's an interesting idea that the entire thing is written in JavaScript, but it doesn't feel like they picked the correct tool to write it in. Just seems like an exercise to see if it is possible. However, it is pretty cool that the thing is cross-platform -- obviously JS makes that very possible. JS syntax is so stringy. Here's some code (from https://github.com/atom/atom/blob/master/src/path-watcher.js[^] ) with interesting comment:

    // Giant-ass brittle hack to hook files (and eventually directories) created from the TreeView.
    const treeViewPackage = await atom.packages.getLoadedPackage('tree-view')
    if (!treeViewPackage) return
    await treeViewPackage.activationPromise
    const treeViewModule = treeViewPackage.mainModule
    if (!treeViewModule) return
    const treeView = treeViewModule.getTreeViewInstance()

    L R S 3 Replies Last reply
    0
    • R raddevus

      Examining the open source Atom editor. It's an interesting idea that the entire thing is written in JavaScript, but it doesn't feel like they picked the correct tool to write it in. Just seems like an exercise to see if it is possible. However, it is pretty cool that the thing is cross-platform -- obviously JS makes that very possible. JS syntax is so stringy. Here's some code (from https://github.com/atom/atom/blob/master/src/path-watcher.js[^] ) with interesting comment:

      // Giant-ass brittle hack to hook files (and eventually directories) created from the TreeView.
      const treeViewPackage = await atom.packages.getLoadedPackage('tree-view')
      if (!treeViewPackage) return
      await treeViewPackage.activationPromise
      const treeViewModule = treeViewPackage.mainModule
      if (!treeViewModule) return
      const treeView = treeViewModule.getTreeViewInstance()

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      raddevus wrote:

      However, it is pretty cool that the thing is cross-platform -- obviously JS makes that very possible.

      If you consider a webbrowser to be a platform, yes. Since webbrowsers do not boot, it is not cross-OS. Your OS would need to come with a browser that supports said JavaScript, making it as cross-platform as GWBASIC.

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

      R V 2 Replies Last reply
      0
      • R raddevus

        Examining the open source Atom editor. It's an interesting idea that the entire thing is written in JavaScript, but it doesn't feel like they picked the correct tool to write it in. Just seems like an exercise to see if it is possible. However, it is pretty cool that the thing is cross-platform -- obviously JS makes that very possible. JS syntax is so stringy. Here's some code (from https://github.com/atom/atom/blob/master/src/path-watcher.js[^] ) with interesting comment:

        // Giant-ass brittle hack to hook files (and eventually directories) created from the TreeView.
        const treeViewPackage = await atom.packages.getLoadedPackage('tree-view')
        if (!treeViewPackage) return
        await treeViewPackage.activationPromise
        const treeViewModule = treeViewPackage.mainModule
        if (!treeViewModule) return
        const treeView = treeViewModule.getTreeViewInstance()

        R Offline
        R Offline
        RickZeeland
        wrote on last edited by
        #3

        Destroy, asteroid style :mad: asteroids[^]

        R 1 Reply Last reply
        0
        • R raddevus

          Examining the open source Atom editor. It's an interesting idea that the entire thing is written in JavaScript, but it doesn't feel like they picked the correct tool to write it in. Just seems like an exercise to see if it is possible. However, it is pretty cool that the thing is cross-platform -- obviously JS makes that very possible. JS syntax is so stringy. Here's some code (from https://github.com/atom/atom/blob/master/src/path-watcher.js[^] ) with interesting comment:

          // Giant-ass brittle hack to hook files (and eventually directories) created from the TreeView.
          const treeViewPackage = await atom.packages.getLoadedPackage('tree-view')
          if (!treeViewPackage) return
          await treeViewPackage.activationPromise
          const treeViewModule = treeViewPackage.mainModule
          if (!treeViewModule) return
          const treeView = treeViewModule.getTreeViewInstance()

          S Offline
          S Offline
          Scott Serl
          wrote on last edited by
          #4

          Visual Studio Code uses the same underlying technology (electron).

          R 1 Reply Last reply
          0
          • S Scott Serl

            Visual Studio Code uses the same underlying technology (electron).

            R Offline
            R Offline
            raddevus
            wrote on last edited by
            #5

            Scott Serl wrote:

            Visual Studio Code uses the same underlying technology (electron).

            :thumbsup: That's interesting. Thanks for mentioning.

            1 Reply Last reply
            0
            • R RickZeeland

              Destroy, asteroid style :mad: asteroids[^]

              R Offline
              R Offline
              raddevus
              wrote on last edited by
              #6

              That is crazy!

              1 Reply Last reply
              0
              • L Lost User

                raddevus wrote:

                However, it is pretty cool that the thing is cross-platform -- obviously JS makes that very possible.

                If you consider a webbrowser to be a platform, yes. Since webbrowsers do not boot, it is not cross-OS. Your OS would need to come with a browser that supports said JavaScript, making it as cross-platform as GWBASIC.

                Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

                R Offline
                R Offline
                raddevus
                wrote on last edited by
                #7

                This editor is a standalone project that runs in Node.js (on V8 I believe) and doesn't require a browser. There are native installs for macOS, Windows and Linux.

                L 1 Reply Last reply
                0
                • L Lost User

                  raddevus wrote:

                  However, it is pretty cool that the thing is cross-platform -- obviously JS makes that very possible.

                  If you consider a webbrowser to be a platform, yes. Since webbrowsers do not boot, it is not cross-OS. Your OS would need to come with a browser that supports said JavaScript, making it as cross-platform as GWBASIC.

                  Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

                  V Offline
                  V Offline
                  Vark111
                  wrote on last edited by
                  #8

                  The browser is bundled with these types of applications. Not that that is necessarily a good thing. Complaints abound of bloat for all these Electron apps.

                  1 Reply Last reply
                  0
                  • R raddevus

                    This editor is a standalone project that runs in Node.js (on V8 I believe) and doesn't require a browser. There are native installs for macOS, Windows and Linux.

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    ..which isn't an operating system either. You're merely changing the name of the loader of the scripts.

                    Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups