Go Back   Winamp Forums > Visualizations > AVS

Reply
Thread Tools Search this Thread Display Modes
Old 14th January 2008, 12:10   #1
shreyas_potnis
Major Dude
 
shreyas_potnis's Avatar
 
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
expression evaluater in AVS source code

Anyone knows how to use the expression evaluator in the AVS source code. Now that it is open source I can use it in my own code, right? Is there any other alternative?

http://home.iitb.ac*****~shreyaspotnis
shreyas_potnis is offline   Reply With Quote
Old 14th January 2008, 13:29   #2
Jaak
Major Dude
 
Jaak's Avatar
 
Join Date: Jan 2003
Location: Estonia.
Posts: 851
Depends on your needs.

If you don't need efficiency then the better alternative is to simply write your own evaluator. AVS script is so primitive that writing an evaluator (slow one) is almost trivial (parser might be little trickier).
If you want portability, then reusing AVS source code is not an option. The code is non-portable mess.

Only use AVS source if portability is not a concern and you really need the evaluator to be fast. But even then it might be easier to translate the script into some intermediate form (llvm, C--) and let the compiler do the optimization.

If you want to evaluate simple arithmetic expression... then really, write your own code. It should be well below 100 lines.

Anyways, you can reuse the AVS code quite freely, I think they use BSD 3 license.

Phi = (1+sqrt(5))/2
Jaak is offline   Reply With Quote
Old 14th January 2008, 13:58   #3
shreyas_potnis
Major Dude
 
shreyas_potnis's Avatar
 
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
i wanted something similar to AVS, arithmetic expressions and simple functions. And I want it to be cross platform. When I checked out the evallib code I noticed it used windows.h
does anyone know any other alternative? should be in c++

http://home.iitb.ac*****~shreyaspotnis
shreyas_potnis is offline   Reply With Quote
Old 14th January 2008, 14:14   #4
Jaak
Major Dude
 
Jaak's Avatar
 
Join Date: Jan 2003
Location: Estonia.
Posts: 851
Then, please, do not use AVS script syntax. You can do so much better than that.

There isn't really easy solution for you. I do not think that there is suitable scripting language already out there, so you probably have to implement your own. It's not that difficult if:
a) you don't use C/C++
b) efficiency is not a concern
c) language is simple enough

If you plan to stick with C/C++ then there are plenty of useful tools to help you. Take a look at yacc and bison. If you're comfortable with "modern" C++ then you should try Boost.Spirit.

Phi = (1+sqrt(5))/2
Jaak is offline   Reply With Quote
Old 14th January 2008, 14:35   #5
shreyas_potnis
Major Dude
 
shreyas_potnis's Avatar
 
Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
hey thanks!

http://home.iitb.ac*****~shreyaspotnis
shreyas_potnis is offline   Reply With Quote
Old 18th January 2008, 15:21   #6
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,149
Send a message via ICQ to jheriko
make one. flex(the new yacc) and bison make it trivial

use c++ and function pointers, i have some examples both with and without flex and bison, i have one that builds some trivial .exes too... but clearly not developed enough to be of any value.

just to warn you though most alternatives out there are much better if you don't care about speed. python would be a good place to start if you just want to get stuff done... not necessarily done quickly.

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 18th January 2008, 16:27   #7
Jaak
Major Dude
 
Jaak's Avatar
 
Join Date: Jan 2003
Location: Estonia.
Posts: 851
I disagree, python doesn't have much advantage over C/C++ , especially if you're new to python.
All the cool kinds nowadays use OCaml (or other MLish language) to write compilers, interpreters and code analysis tools.

Phi = (1+sqrt(5))/2

Last edited by Jaak; 18th January 2008 at 19:17.
Jaak is offline   Reply With Quote
Old 28th January 2008, 09:24   #8
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,149
Send a message via ICQ to jheriko
Quote:
Originally posted by Jaak
I disagree, python doesn't have much advantage over C/C++ , especially if you're new to python.
Erm... someone else already made an interpreter?

That makes it several orders of magnitude easier imo...

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Visualizations > AVS

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump