5 ms·
I'm not sure how the parser and lexer/etc. line count matters for the VM line count. shrug Definitely something I'll be looking at for my embedded work; it may
by davelnewton 8y ago
I'm not sure how the parser and lexer/etc. line count matters for the VM line count. shrug
Definitely something I'll be looking at for my embedded work; it may fill a gap in my toolchain. And boo-hiss tabs.
- filmor 8y agoParser and lexer matter for the multipass compiler.
- davelnewton 8y agoWhich isn't the VM, right?
- tom_mellior 8y agoNo, it's the compiler. Are you still overlooking the phrase "the multipass compiler code is about 3K lines" in my original post above?
- Sean1708 8y ago> And boo-hiss tabs. At the risk of starting a flame-war: boo-hiss not using a formatter.
- davelnewton 8y agoOrthogonal. Once you have tabs, any viewing of that file will rely on the tab size set by whatever viewer you're using: mixing tabs and spaces basically never works. At least if it's just tabs everything will be seen wrong consistently. The only reliable mechanism is spaces-only. :p
- Sean1708 8y agoBut if you're using a formatter then it doesn't matter whether you use tabs, spaces, minimal whitespace, or any mix thereof because that's what the formatter is for. Also if you're using a formatter then you can do the correct thing and use tabs for indentation and spaces for alignment, because the formatter will ensure that the output is consistent.
- davelnewton 8y agoThe output is consistent if your tab settings are always the same when you look at your code, and you use the same tab size across all languages. I view code in multiple ways, have different indentations for different languages (not many different now), and have clients that enforce difference indentation settings. It just doesn't work.
- Sean1708 8y ago> The output is consistent if your tab settings are always the same when you look at your code, and you use the same tab size across all languages. I don't really understand what you're getting at here to be honest, surely if you change your tab settings it's because you want the code to look different? > I view code in multiple ways, have different indentations for different languages (not many different now), This is exactly what tabs are great for! You can set the tab width based on language without having to force that choice on anyone else. > clients that enforce difference indentation settings Again, formatter.
- davelnewton 8y agoI'm not sure if you're being deliberately obtuse, or just never look at files in only one way. I don't have that luxury. Say I have a project that has Java and Rhino (JavaScript) files. My IDE/editor is configured for Java with TAB==4, JavaScript TAB==2. Everything looks great in my editor, because it knows things. Now I'm using `less` or `cat` in my shell. Or ssh-ing to a remote box because of an emergency production issue. Or whatever. Now when I look at the file things no longer line up as originally intended, because when I view them outside of the (relatively) smarter IDE the TAB characters are at the mercy of whatever I am using to view the file. You cannot simply rely on local tab width settings if files use a mix of tabs and spaces for indentation and alignment: if you change the tab width then alignment breaks. If you never align anything, great, tabs work great for indentation (except for when you can't trivially change it, then they suck). But indentation isn't the only thing tabs are used for. There's the rub: TAB characters will always be at the mercy of how I'm viewing the file, which I do not always have control over, and certainly not (trivially) based on the type of the file.