Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Best language for PostScript output

I've written software for too many years (punched cards in 1970), so I think I can learn just about any language (eventually, grin). I have a bunch of graphics software that I wrote in a language that appears to be dying (TransEra's HiTech BASIC clone of HP's Rocky Mountain Basic). Over the years, I've gotten pretty fluent in PostScript. I've probably re-written half the graphics commands in HTB as my own subs that actually output PostScript correctly . What I'd like to do is to write a new version of that graphics software. [b]What language/environment would you recommend?[/b]

[b]Wish list:[/b]
* I use vector graphics, not bitmap. This is mandatory. If the language has a way to paint vector graphics on the screen, it would make my life much easier. Final output is PostScript (vector), which I distill to PDF.
* I use very large data sets. I'd like to be able to manipulate arrays of floating-point numbers that have more than 32K elements in a dimension. Being able to perform matrix math is a big plus.
* I tend to use a lot of logarithm/exponential functions, so I don't want something that makes that slow or hard to access (can't imagine that would be a problem with a modern language).
* If possible, I'd rather work under Linux than Windows, but that's not a hard requirement. I'm just getting tired of dealing with BSODs, driver conflicts, etc.
* I want to design the charts myself. I've never seen a packaged routine that does the kinds of things that I want to do, and I'm always thinking of new formats, so an off-the-shelf graphics subroutine package is an unlikely option.

Comments

  • SephirothSephiroth Fayetteville, NC, USAPosts: 1,035Member
    The step I took when going from the limited Basic languages to something more powerful, was to go to C. Picking up C should be easy enough as it is procedural like Basic, but it can do SO much more. There are subtle differences, such as having to use a colon on the end of every line of code, but there are plenty of people here who can help you with any problems you may encounter.

    In C, you have near-total control of how things work. You want to use bitmaps, do it. You want vector-graphics, go for it! Your potential is virtually unlimited with C and you could use any format you want to.

    As for the 32k elements, in C you are only limited by available memory. You could have a billion elements in an array if you had the RAM for it. With linked-lists or fast loops on normal arrays you could easily access all of your elements very quickly. You can also use SSE or something else if you care to for more speed.

    As for your own charts, you can again do that in C with ease. By default your wouldn't be using any external libraries. You would have to link to external libraries yourself to use pre-made charts and such.

    If you have any specific questions, feel free to ask. I check by every few days.

    -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]
  • chartguychartguy Posts: 2Member
    Thank you!

    From what I've gleaned, it sounds like C++ might be a better approach. Given the nature of what I'm trying to do objects seem like a natural approach. There are various types of data (e.g., Close only, or Volume/High/Low/Close), and with OOP, I can send them to the same sub and have it process them appropriately (I think they call that overloading).

    This is probably way too simple, but what is a good, stable way to run C++? I look at something like MSFT's Visual Studio and think it's got way too many bells and whistles. I don't need to produce fancy GUIs. My degree was in math. I think I took two semesters of CS, so I apologize if it's a stupid question, but what C++ do I start with?

    Thank you very much!
  • SephirothSephiroth Fayetteville, NC, USAPosts: 1,035Member
    I use Visual Studio 2005 Pro. I normally only install the C and VB components however, and have only used VB once. I love C++ but my programming history evolved from Atari Basic/Atari ASM to QuickBasic in DOS, then to C in Win9X, and finally C++ in XP. C++ is much better than C, but it is also a tad more complicated to learn. If you're up to it though, C++ is what I would whole-heartedly recommend to any aspiring programmer. I also [b]never[/b] recommend VB, C#, or the .NET platform to people since it limits their code to Windows. I believe in hitting the larger audience, including Mac and Linux users. No, I don't personally use a Mac, but I use Linux for everything except gaming!

    In C++ there isn't a "subroutine" like in Basic. Each class has various functions, which are referred to as "methods". Overloading involves naming to methods identical to each other, but passing different parameters and/or returning a different variable type. Example below.
    [code]
    class TestObject
    {
    public:
    TestObject(); //Default constructor
    TestObject(wchar_t*); //Parameterized constructor
    virtual ~TestObject(); //Class destructor

    protected:
    void MyName(wchar_t*); //Pass a pointer to a string and store it
    wchar_t* MyName(); //This method would then return the string

    private:
    wchar_t *pName;
    };
    [/code]
    Assuming you wrote code for those methods, you would write two for the "MyName" method. One would return nothing and accept a pointer to a string of UNICODE characters and set the internal (private) "pName" pointer to that string. The other method would return a pointer to said string. They both have the same name, but return different values and accept different parameters.

    One final thing to note is that ANSI is dead. If you're going to pick up Windows programming and C++, I would recommend you learn to do it in UNICODE. UNICODE is much better than ANSI and allows you to do so much more with your code, as well as reach people who may use a different character-set than you. Let me know if you have any questions about it.

    -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]
Sign In or Register to comment.