9 ms·
Disassembling Sublime Text
- jewbacca 10y ago"draw_shadows": false Fuck yes. I run into this as a (minor) problem all the time. Should be exposed by default. What a cool exercise in general.
- trishume 10y agoYah the work day before I did this I actually was using Sublime on a portrait monitor where the line length limit in our source guidelines fit at my font size, but since the shadow kicks in slightly before the line actually goes off screen, it created a shadow. So I was pleased to find that as well.
- jrochkind1 10y agoI don't understand what the 'shadow effect' is, I'm staring at my unmodified ST window, and am not sure what to look for. What I really want is to make ST3 sidebar menu look like it did in ST2!
- jewbacca 10y ago`draw_shadows` effects the shadow cast by the Sublime "minimap" -- the code shape outline on the right side of the window. You can see the effect of turning it off by comparing the right sides of the single pair of (before/after) screenshots in the article. before: http://thume.ca/assets/postassets/sublimesecrets/debug_render.png http://thume.ca/assets/postassets/sublimesecrets/debug_rende... after: http://thume.ca/assets/postassets/sublimesecrets/configs.png http://thume.ca/assets/postassets/sublimesecrets/configs.png
- jrochkind1 10y agoAha, the first thing I do in ST is turn off the minimap completely, so that explains that! Thanks!
- trishume 10y agoYou need a file with a line longer than your window is wide. Then whichever side(s) of your window have content scrolled off the side of them will have a slight shadow effect on them. It's actually quite cool and I think indicative of the kind of polish present in Sublime but not other editors. But I can see some finding it annoying in some circumstances. Also, after discovering this I Googled it and saw that some other people mentioning it (no hits for the other settings) in connection to the Soda theme, so maybe if you are using that it might already be disabled? I'm not sure.
- yread 10y agoWhat is a modern disassembler on windows nowadays if I'm too cheap for IDA?
- kkirsche 10y agoI think Binary Ninja may support Windows but would need to double check
- adamnemecek 10y agoI think that x64dbg is pretty good http://x64dbg.com/ http://x64dbg.com/
- yread 10y agoThat looks pretty good! It's really similar to OllyDbg. Is that just a UI theme?
- 0xcoffee 10y ago>"I’m the main developer of x64dbg, which is heavily influenced by OllyDbg and offers similar features but on the 64-bit platform." Source: http://mrexodia.cf/x64dbg/2016/01/31/OllyDbg http://mrexodia.cf/x64dbg/2016/01/31/OllyDbg
- vuanotinb 10y agoThere's torrent... If it's for personal use, there are many countries where it is not illegal to torrent software. Yours might be one of them.
- Buge 10y agoTorrenting involves uploading data, which is considered distributing content you don't own. So I think torrenting copyrighted content is illegal most places. A regular http download might be legal though more places.
- jhurliman 10y ago
- userbinator 10y agoI also tried to figure out how some parts of the editor work and why they are so fast, but I couldn’t figure out much from the assembly. Those who are interested in text editor design may find this series and the links therein useful: http://www.catch22.net/tuts/neatpad http://www.catch22.net/tuts/neatpad
- trishume 10y agoYah I'd read that, so I looked for signs of a piece table, but couldn't find any. Which doesn't necessarily mean that it isn't using one. I suspect that Sublime Text either doesn't use a piece table, or uses one that only breaks pieces at line boundaries. The reason being that the highlighting relies on running regexes on one line at a time, and it uses oniguruma for this sometimes, and oniguruma requires the entire haystack to be in one array. However, Sublime doesn't highlight super long lines because it would be too slow, so it could break its piece table on incredibly long lines so that editing them could still be fast. I was also looking for fancy rendering and highlighting tricks, but couldn't decipher any.
- mfukar 10y agoRe: data structures, ST could also use ropes, or gap buffers.
- teddyh 10y agoOr the classic The Craft of Text Editing from 1999: http://www.finseth.com/craft/ http://www.finseth.com/craft/
- deleted 10y ago[deleted]
- Zaheer 10y agoI recently installed VSCode just to try and was pleasantly surprised. For Sublime users there's a plugin to remap all keyboard shortcuts to Sublime ones (when available ex. multi-line edit isn't just yet). VSCode is getting updates on a monthly basis it seems and I have no doubt it'll catch up to Sublime in the next 6-12 months.
- ino 10y agoIf I already have a Sublime license, and I'm happy and it fulfils my needs perfectly, what would I gain in spending the time to try to get my workflow working in VSCode if it still hasn't caught up, as you say?
- adamrezich 10y agoUp-to-date plugin ecosystem, especially if you write code in trendy languages. But if your workflow ain't broke, don't fix it, right?
- paulddraper 10y ago> I'm happy and it fulfils my needs perfectly Have you not answered your own question?
- nathancahill 10y agoIt's closer to an actual IDE for JS than Sublime is (even once you install a bunch of ST plugins). Especially for TypeScript. That said, if Sublime is working for you, stick with it.
- bubersson 10y agoIf it fulfills your needs perfectly then there's no need to change. It may be still worth playing with a bit and doing tooling investigation to find out if there are some super useful features for your case. I switched to vscode from sublime recently, because it has much better autocompletion and "goto definition" especially when working with JS and TypeScript code, which is exactly what I need. Other than that I was able to replicate all features from Sublime (e.g. multipoint editing) and I'm not aware of any missing feature from what I used in Sublime. One con is that vscode is slower to start and slower to open up a file.
- vuanotinb 10y agoNice, but I wonder how much time has Sublime left now that VSCode, which is better and free, is out.
- kitsunesoba 10y agoVS Code is very good for what it is but there are still some telltale web app cracks and gaps scattered about, and of course its resource usage is considerably higher than Sublime's (I'm seeing ~240MB RAM usage on a fresh install with no documents open). I suspect that until these two factors are fixed there will still be those who prefer Sublime.
- roywiggins 10y agoI've tried firing up VSCode in a VM and found it unusably slow, whereas Sublime is fine.
- MikusR 10y agoWhat OS are you using that has no native VS code support?
- scott_karana 10y agoHe could also be _working_ in a VM, when his host OS supports it but he's not using the host at the time.
- wishinghand 10y ago> which is better and free Please backup claims with evidence.
- rvanmil 10y agoPlenty of time as long as VSCode is running on Electron.
- trishume 10y agoVSCode is better in some ways for a couple languages that it has nice debuggers for. Otherwise Sublime has a lot on it. Sublime is faster and is crazy polished. It also has a larger plugin ecosystem.
- ncdr 10y agoIs this legal?
- breul99 10y agoMost EULAs prohibit it, probably not.
- trishume 10y agoSublime's doesn't: https://www.sublimetext.com/eula https://www.sublimetext.com/eula
- creshal 10y agoMost EULAs aren't legally binding either.
- bitwize 10y agoVernor v. Autodesk. Look it up. EULAs are legally binding contracts in the USA.
- jtl999 10y agoAnd plenty of people don't live in the USA. :)
- guitarbill 10y agoe.g. Sublime HQ Pty Ltd, which is Australian: https://www.sublimetext.com/buy?v=3 https://www.sublimetext.com/buy?v=3
- trishume 10y agoAFAIK yes. It's not illegal to look at how something works. There are some dumb laws in the US about circumventing and changing things, but I didn't actually touch anything. I would also be more skittish if I was looking at the license key validation code, but I didn't since I bought a license a long time ago (it was totally worth it).
- adamrezich 10y agoSlightly OT: I've never heard of Skia before, but a few years ago I was trying to find a good vector graphics solution for realtime video games... can it be used for that?
- surfmike 10y agoIt definitely could, as far as I understand it's the underpinning for all of Chrome's graphics for instance, including Canvas.
- trishume 10y agoDepends how complex your video game is. It has a GPU back end so it can be pretty fast, but it is still focused on very high quality antialiased rendering so it isn't crazy fast. Apps like Chrome and Sublime don't repaint the entire screen every frame or when scrolling, only the parts that change, so they can afford high quality.
- ensiferum 10y agoYou probably could but you're having a bad time compiling and building Skia. It uses a peculiar build system (that is used throughout the chromium ecosystem). It does have a performance in mind and even comes with a tool (nanobench) to measure perf. That being said for a game you'd probably be better off with a higher level engine that also manages the scene graph, spatial sorting etc things for you unless you want to work on that part yourself.
- khedoros1 10y ago> If I spent an entire day I might be able to reverse engineer one function Yep, that's kind of the way it works, when you start out. Then you get used to some of the patterns that the compiler uses, and you can get through several in a day, if you're lucky!
- halotrope 10y agoAh Sublime2 was my first binary-cracking project. After countless hours of debugging with GDB and trying to understand assembly in Hopper I managed to disable the nag and patch the binary. (Purely for fun. I bought a license shortly after, of course I did not distribute this in any way). Will never forget how proud and satisfied I felt when it finally worked. While mostly using Jetbrains or Atom with VIM plugin for development these days I still value Sublime for being able to handle really big files a million times better than Java/Web based editors.
- istareldritch 10y agoIf you use Atom with VIM plugins why not use NeoVim or vim directly? It opens huge files as fast as sublime does. You have plenty of plugins to adequate your needs, definitely not as advanced as IntelliJ but I would say better than Atom.
- 58028641 10y agoAtom has a better GUI than VIM.
- seanp2k2 10y agoAnother alternative: http://spacemacs.org http://spacemacs.org
- flukus 10y agoVim is still a lot better at handling window splits.
- gaving 10y agonot for much longer https://www.youtube.com/watch?v=rzclz1seo0g https://www.youtube.com/watch?v=rzclz1seo0g
- imron 10y agoPeople don't use VIM for its GUI.
- 10y ago
- hthh 10y agoWow, in a happy coincidence syntect is exactly what I was looking for all last week! Now I just need to figure out Rust.
- trishume 10y agoCool, email me if you need any help with it. In fact, email me regardless of if you need help telling me what your project is and how syntect might help.
- mungoid 10y agoAbout once a year I get a hankering to mess with disassembling something but usually after countless screenshots, open tabs, notes, etc. I remember that I am terribly slow with assembly.
- c-smile 10y agoI am wondering why someone even want to disassemble any editor these days... There is no mystery in principle. Take Scintilla if you want to study editor in source code. That is straightforward implementation but works well enough. As of syntax highlighting ... You can use either regexp'es or, which is better, some predefined tokenizers. Pretty much all programming languages have concepts of NMTOKENs (keywords variable names), string literals, numbers, comments. You can write very fast tokeneizers/scanners that will give you basic blocks. If needed you can pass these blocks to regexp for further processing. That will give you very fast processing. If to deal with markup languages then use separate tokenizer. Almost 10 years ago I've written this: https://www.codeproject.com/Articles/14076/Fast-and-Compact-HTML-XML-Scanner-Tokenizer https://www.codeproject.com/Articles/14076/Fast-and-Compact-... , tens of megabytes of XML/HTML processing per second...
- trishume 10y agoIf you look at the article, you'll see that I wrote a full clone of Sublime Text's syntax highlighter before even opening a disassembler. I do in fact know how to do syntax highlighting. And yes I read lots of Scintilla's code years ago. I did a couple hours of disassembly reading purely out of curiosity and to find exactly the kind of hidden goodies that I ended up finding.
- mcpherrinm 10y ago> snappy: Fast compression, not sure what it is used for Quite possibly leveldb, listed immediately above snappy, which can optionally compress content with snappy.
- Shugyousha 10y agoThe sregex the page mentions is most likely this one: https://github.com/openresty/sregex https://github.com/openresty/sregex Its distinguishing feature is that it's a regex library that matches streams (hence 's'regex).
- wbond 10y agoThis is not the same library, although they do share a name.
- nailer 10y ago> draw_debug > A boolean that if true enables a special debugging text renderer. It seems to turn sections of the document either blue or red, and within the sections it turns tokens alternating light and dark shades of those colours. Note you have to set the setting to false to turn it off, not just delete it. These change sometimes when scrolling and editing but I can’t figure out when and why. That sounds exactly like GPU layers in web development - green is GPU accelerated, red is unaccelerated.