What is a powerful, lightweight text editor with intuitive GUI/functionality? - editor

To date in my programming career I've been using gedit for everything, but I am beginning to feel it isn't powerful enough.
However, I find that EMACS and VIM are too annoying because of the massive number of unintuitive keyboard shortcuts, and the inability to do simple things like click and drag to select things, ctrl+c, ctrl+v, etc. Also, any editor with different modes is really annoying to me.
On the other hand, gedit lacks a lot of the powerful things VIM and EMACS seem to be able to do. I have seen my coworkers do things like pop open a list of all files containing a certain regular expression to open, or compile and execute a selected block of code in a single stroke.
I've installed all the gedit plugins I can find, but it's hard to customize them to the extent I want to, and a lot of them just suck. For example, ctrl-alt-o for quick open seems to simply provide a short list of recently opened files. And the integrated command line plugin is pretty awful. The autocomplete plugin is decent, but it would be much better if it could show me a list of all the available methods of an object the way ipython does.
Is there an editor out there that functions more or less like normal text editors, but with the customizability and support you get from VIM/EMACS? Or is there a build for VIM/EMACS out there that feels like a normal editor without all the confusing modes or need for encyclopedic knowledge of keyboard shortcuts?
I mostly program in python, coffeescript, java, and am about to start using C++ a lot, plus I occasionally do things in other languages, so functionality across multiple languages is a must.

A coworker of mine likes Geany and he uses it for C and Javascript development. I don't know anything about except that it's more powerful than Gedit, but doesn't have the same feel as VIM/EMACS.
You can also try behave mswin in VIM: https://superuser.com/questions/10588/how-to-make-cut-copy-paste-in-gvim-on-ubuntu-work-with-ctrlx-ctrlc-ctrlv. I don't like it, but another coworker does. It changes the whole feel of VIM, which might be what you want.
I would just recommend picking a more powerful editor and get used to it. VIM/EMACS are good editors, but trying to make them behave other than they were designed may cause problems down the line (especially when looking for help).

I would really recommend taking the time to learn something like Vim. You might find it easier than you think.
Cream is a version of Vim modified to have an easier user interface.
http://cream.sourceforge.net/

Related

Navigating a large ruby codebase, like rails

I've been a java developer for most of my career, and developed and maintained some pretty large code bases.
now that I've been developing in rails for a while I've left my IDE behind and I want so start looking at the actual rails source. I've mainly been using the github interface which is actually quite good but I wondered if there were tips and techniques from more seasoned ruby devs?
What I'm missing mainly is my trusted eclipse features like "find usage" or "goto implementaton". Perhaps a paradigm shift is in order... please enlighten me :P
Since you're an Eclipse user I'd recommend Rubymine. It gives you a lot of the same features and has good integration with rails. It has good support for jumping to implementation/usage, although this is a harder problem in ruby than java. When Rubymine can't determine which implementation is the correct one, you're usually given a list of all matching methods.
I personally use Vi and haven't had trouble navigating rails projects, usually it's a matter of convention and familiarity that just comes with working on the same project for enough time. I default to using grep or find for usages etc.
The problem is that things like "goto implementation" and its ilk may require deep knowledge of the runtime. Some methods may not exist until after an initialization or mixin process. Duck typing means that anything that responds to a message is a potential type candidate.
I'm reasonably happy with IntelliJ (Rubymine), but you won't find the same level of navigational support you get from a language like Java, where most everything is known up front. It's simply less navigable than Java code, IMO.
The things that can be known, like explicitly-defined methods, "obvious" calls, and so on are navigable, and IMO right now IntelliJ does it the best, but I haven't used an Eclipse Ruby environment for some time, so the situation may be different now--but I'm often surprised at how well it does do, considering the circumstances.
That said, I flip back-and-forth between IntelliJ, TextMate, Sublime Text 2, and Emacs. TextMate is nearly useless to me because of its single-pane design. For quick stuff or small projects, it's adequate.

Custom programming language: how?

Hopefully this question won't be too convoluted or vague. I know what I want in my head, so fingers crossed I can get this across in text.
I'm looking for a language with a syntax of my own specification, so I assume I will need to create one myself. I've spent the last few days reading about compilers, lexers, parsers, assembly language, virtual machines, etc, and I'm struggling to sort everything out in terms of what I need to accomplish my goals (file attached at the bottom with some specifications). Essentially, I'm deathly confused as to what tools specifically I will need to use to go forward.
A little background: the language made would hopefully be used to implement a multiplayer, text-based MUD server. Therefore, it needs easy inbuilt functionality for creating/maintaining client TCP/IP connections, non-blocking IO, database access via SQL or similar. I'm also interested in security insofar as I don't want code that is written for this language to be able to be stolen and used by the general public without specialist software. This probably means that it should compile to object code
So, what are my best options to create a language that fits these specifications
My conclusions are below. This is just my best educated guess, so please contest me if you think I'm heading in the wrong direction. I'm mostly only including this to see how very confused I am when the experts come to make comments.
For code security, I should want a language that compiles and is run in a virtual machine. If I do this, I'll have a hell of a lot of work to do, won't I? Write a virtual machine, assembler language on the lower-level, and then on the higher-level, code libraries to deal with IO, sockets, etc myself, rather than using existing modules?
I'm just plain confused.
I'm not sure if I'm making sense.
If anyone could settle my brain even a little bit, I'd sincerely appreciate it! Alternatively, if I'm way off course and there's a much easier way to do this, please let me know!
Designing a custom domain-specific programming language is the right approach to a problem. Actually, almost all the problems are better approached with DSLs. Terms you'd probably like to google are: domain specific languages and language-oriented programming.
Some would say that designing and implementing a compiler is a complicated task. It is not true at all. Implementing compilers is a trivial thing. There are hordes of high-quality compilers available, and all you need to do is to define a simple transform from your very own language into another, or into a combination of the other languages. You'd need a parser - it is not a big deal nowdays, with Antlr and tons of homebrew PEG-based parser generators around. You'd need something to define semantics of your language - modern functional programming langauges shines in this area, all you need is something with a support for ADTs and pattern matching. You'd need a target platform. There is a lot of possibilities: JVM and .NET, C, C++, LLVM, Common Lisp, Scheme, Python, and whatever else is made of text strings.
There are ready to use frameworks for building your own languages. Literally, any Common Lisp or Scheme implementation can be used as such a framework. LLVM has all the stuff you'd need too. .NET toolbox is ok - there is a lot of code generation options available. There are specialised frameworks like this one for building languages with complex semantics.
Choose any way you like. It is easy. Much easier than you can imagine.
Writing your own language and tool chain to solve what seems to be a standard problem sounds like the wrong way to go. You'll end up developing yet another language, not writing your MUD.
Many game developers take an approach of using scripting languages to describe their own game world, for example see: http://www.gamasutra.com/view/feature/1570/reflections_on_building_three_.php
Also see: https://stackoverflow.com/questions/356160/which-game-scripting-language-is-better-to-use-lua-or-python for using existing languages (Pythong and LUA) in this case for in-game scripting.
Since you don't know a lot about compilers and creating computer languages: Don't. There are about five people in the world who are good at it.
If you still want to try: Creating a good general purpose language takes at least 3 years. Full time. It's a huge undertaking.
So instead, you should try one of the existing languages which solves almost all of your problems already except maybe the "custom" part. But maybe the language does things better than you ever imagined and you don't need the "custom" part at all.
Here are two options:
Python, a beautiful scripting language. The VM will compile the language into byte code for you, no need to waste time with a compiler. The syntax is very flexible but since there is a good reason for everything in Python, it's not too flexible.
Java. With the new Xtext framework, you can create your own languages in a couple of minutes. That doesn't mean you can create a good language in a few minutes. Just a language.
Python comes with a lot of libraries but if you need anything else, the air gets thin, quickly. On a positive side, you can write a lot of good and solid code in a short time. One line of python is usually equal to 10 lines of Java.
Java doesn't come with a lot of frills but there a literally millions of frameworks out there which do everything you can image ... and a lot of things you can't.
That said: Why limit yourself to one language? With Jython, you can run Python source in the Java VM. So you can write the core (web server, SQL, etc) in Java and the flexible UI parts, the adventures and stuff, in Python.
If you really want to create your own little language, a simpler and often quicker solution is to look at tools like lex and yacc and similar systems (ANTLR is a popular alternative), and then you can generate code either to an existing virtual machine or make a simple one yourself.
Making it all yourself is a great learning-experience, and will help you understand what goes on behind the scenes in other virtual machines.
An excellent source for understanding programming language design and implementation concepts is Structure and Interpretation of Computer Programs from MIT Press. It's a great read for anyone wanting to design and implement a language, or anyone looking to generally become a better programmer.
From what I can understand from this, you want to know how to develop your own programming language.
If so, you can accomplish this by different methods. I just finished up my own a few minutes ago and I used HTML and Javascript (And DOM) to develop my very own. I used a lot of x.split and x.indexOf("code here")!=-1 to do so... I don't have much time to give an example, but if you use W3schools and search "indexOf" and "split" I am sure that you will find what you might need.
I would really like to show you what I did and past the code below, but I can't due to possible theft and claim of my work.
I am pretty much just here to say that you can make your own programming language using HTML and Javascript, so that you and other might not get their hopes too low.
I hope this helps with most things....

I'm using TextMate at the moment, any reason for moving to Coda or MacVim?

I'm using TextMate at the moment as editor and it seems to be good for many tasks. Coda and MacVim are quite popular as well, so I was just wondering if there are any reasons/advantages to use those Editors instead of TextMate.
Other solutions are accepted as well.
I moved from TextMate to MacVim. My -- entirely personal and subjective -- reason for switching was the breadth of available documentation, plugins, hacks, tutorials, etc. for Vim. It made it easier for me to research ways to quickly perform common tasks.
Another turning point for me was the realization that the entire TextMate project hinges upon how much or little attention it gets from its author. Case in point: a while back an update was released that broke a feature I use quite often. The problem was rectified within a couple of weeks, but I didn't like the feeling that my hands were tied while I waited for the developer to fix it.
Also, once I grokked Vim's motion commands, I didn't really want to use anything else for writing text.
Absolutely no advantage, pure personal preference, I've just started using Coda, having moved from using Smultron. Coda is great for web dev/design (not really done much software programming, just PHP, jQuery etc)
I haven't used TextMate, but I abhor Coda for anything but simple HTML or CSS. It's shocking for anything with actual programming (jump to function definition? Code folding? What's that?)
Not to start another editor flame war, but why not Emacs? I use textMate sometimes still, but Emacs runs across all platforms. I use it for R with ESS, Python, and LaTeX.
edit- i should add I'am unfamiliar with Coda. Whatever works best for you!
I've been a long user of Coda, simply because when I was getting started with web development, Coda was immensely popular and repeatedly mentioned. I've never looked elsewhere because Coda hit the right balance between functionality and ease of use/unclutteredness. However, recently, Coda's lack of decent support for HAML and my inability to add that support by writing a plugin forced me to look elsewhere. While I'm yet to try out TextMate, for pure web development, not just a text editor, I would recommend Espresso. It's got a much better editor than Coda, even including Karpie's beloved code folding.

Is it possible to make an advanced rich text editor for web that would allow copy-pasting of pictures?

The long story:
The larger problem is that I'm trying to convince people from switching away from Outlook to a more sane bugtracker, preferably web-based that we could also use as a public bugtracker. But the current argument against it is that the Outlook editor (which is really Word with all the bells and whistles) allows easy inserting of pictures, advanced formatting, etc. So I wonder if I'm at a dead end, or there is hope yet.
The problem in a nutshell:
I want to know - is it possible to create a website component that would be a REALLY powerful rich text editor. A must-have feature is to insert pictures into the editor straight from the clipboard. Better yet - does something like that exist?
There is no limit on the allowed technology. It can be flash based, java based, work only in IE, etc.
Is it possible: Yes, but not with JavaScript alone. You will need a plugin or client software to accomplish this.
As far as the technology allowed, this really depends on how you want to implement it. You could use the JRE and write everything in Java. If you're more focused on IE you might consider VB or C#.

Game Engine Scripting Languages

I am trying to build out a useful 3d game engine out of the Ogre3d rendering engine for mocking up some of the ideas i have come up with and have come to a bit of a crossroads. There are a number of scripting languages that are available and i was wondering if there were one or two that were vetted and had a proper following.
LUA and Squirrel seem to be the more vetted, but im open to any and all.
Optimally it would be best if there were a compiled form for the language for distribution and ease of loading.
One interesting option is stackless-python. This was used in the Eve-Online game.
The syntax is a matter of taste, Lua is like Javascript but with curly braces replaced with Pascal-like keywords. It has the nice syntactic feature that semicolons are never required but whitespace is still not significant, so you can even remove all line breaks and have it still work. As someone who started with C I'd say Python is the one with esoteric syntax compared to all the other languages.
LuaJIT is also around 10 times as fast as Python and the Lua interpreter is much much smaller (150kb or around 15k lines of C which you can actually read through and understand). You can let the user script your game without having to embed a massive language. On the other hand if you rip the parser part out of Lua it becomes even smaller.
The Python/C API manual is longer than the whole Lua manual (including the Lua/C API).
Another reason for Lua is the built-in support for coroutines (co-operative multitasking within the one OS thread). It allows one to have like 1000's of seemingly individual scripts running very fast alongside each other. Like one script per monster/weapon or so.
( Why do people write Lua in upper case so much on SO? It's "Lua" (see here). )
One more vote for Lua. Small, fast, easy to integrate, what's important for modern consoles - you can easily control its memory operations.
I'd go with Lua since writing bindings is extremely easy, the license is very friendly (MIT) and existing libraries also tend to be under said license. Scheme is also nice and easy to bind which is why it was chosen for the Gimp image editor for example. But Lua is simply great. World of Warcraft uses it, as a very high profile example. LuaJIT gives you native-compiled performance. It's less than an order of magnitude from pure C.
I wouldn't recommend LUA, it has a peculiar syntax so takes some time to get used to. Depending on who will be doing the scripting, this may not be a problem, but I would try to use something fairly accessible.
I would probably choose python. It normally compiles to bytecode, so you would need to embed the interpreter. However, if you must you can use PyPy to for example translate the code to C, and then compile it.
Embedding the interpreter is no issue. I am more interested in features and performance at this point in time. LUA and Squirrel are both interpreted, which is nice because one of the games i am building out is to include modifiable code, which has an editor in game.
I would love to hear about python, as i have seen its use within the battlefield series i believe.
python is also nice because it has actual OGRE bindings, just in case you need to modify something lower-level on the fly. I don't know of any equivalent bindings for Lua.
Since it's a C++ library, I would suggest either JavaScript or Squirrel, the latter being my personal favorite of the two for being even closer to C++, in particular to how it handles tables/structs and classes. It would be the easiest to get used to for a C++ coder because of all the similarities.
However, if you go with JavaScript and find an HTML5 version of Ogre3D, you should be able to port your game code directly into the web version with minimal (if any) changes necessary.
Both of these are a good choice, and both have their pros and cons, but both would definitely be the easiest to learn since you're likely already working in C++. If you're working with Java, the same may hold true, and if it's Game Maker, you wouldn't need either one unless you're trying to make an executable that people wouldn't need Game Maker itself to run, in which case, good luck finding an extension to run either of these.

Resources