Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Easy solution: you enter your source with ASCII approximations, and the language implementation can prettify it in-place with the canonical Unicode characters if you choose.


> the language implementation

No need to touch the language, it can be done on the fly by the editor.

It's already possible to do such things in Emacs, for instance: haskell-mode can be configured to replace `\` by `λ`, `>=` by `≥`, `.` (the function composition operator) by `∘`, etc…[0] in the visual display of the file (the underlying source keeps the original tokens).

Of course you could add these new characters in the language's definition itself as well, so the editor can perform direct source replacements.

[0] http://www.haskell.org/haskellwiki/Haskell_mode_for_Emacs#Us... for the list


Good point. Plus there’s something to be said for separating content from presentation, which seems to be a pervasive problem in programming languages, given all the petty arguments about formatting.


> Plus there’s something to be said for separating content from presentation

Indeed, I would enjoy a world where this is done better (and more often), for instance having things like alignments, line-breaks or indentation be completely independent from the actual source.

Of course, this generates a number of other problems in turn: different software on a given machine have to all use the same configuration (or be independently configured to match), communications becomes much harder unless new data pointers are invented as the concepts of line and column become fuzzy, some tools/concepts become impractical to say the least (a context diff for instance, would have a hard time working correctly unless it was token-aware and language-aware with diff/patch reader software able to use the global source formatting configuration for the language to display the diff as the user expects), and shared data display (e.g. a github source view) would be rife with strife.

At the end of the day, I'm not sure this wouldn't create as many problems as it solves, if not more.


I think this is a very sane approach. The same thing exists in vim for python (https://github.com/ehamberg/vim-cute-python).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: