Conversation
fix issue [#3](https://code.google.com/p/lslforge/issues/detail?id=3) - make it work on OSGrid - fix cast of cast blame [pells...@gmail.com](https://code.google.com/u/101374969631348043816/) taken from RayZopf/LSLForge_patched@a037e49 RayZopf/LSLForge_patched@8a3fbc1
modify Render.hs so that version of used LSLForge (executable/preprocessor) is stated in processed lsl script - 'Render.hs' should be removed for release/when in sync - LslForge.hs needs to be kept in sync - should be kept in sync with LSLForge.cabal version number too taken from RayZopf/LSLForge_patched@7053b65
addressing issues: - https://code.google.com/p/lslforge/issues/detail?id=9#c1 (Compiler doesn't properly detect using variable out of scope) - https://code.google.com/p/lslforge/issues/detail?id=1 (Redeclaration of built-in functions doesn't show error) - https://code.google.com/p/lslforge/issues/detail?id=10 (Conflict of global/local variables in modules) for patch blame [pells...@gmail.com](https://code.google.com/u/101374969631348043816/) taken from RayZopf/LSLForge_patched@c521e21 RayZopf/LSLForge_patched@c115fcb
adressing issues - https://code.google.com/p/lslforge/issues/detail?id=40 (llJson* Not implemented) - (redone) https://code.google.com/p/lslforge/issues/detail?id=18 (Lslforge corrupts data during optimization) also update LSLForge cabal given patch was not used; - changed version number - added dependency json (== 0.7.*) blame [pells...@gmail.com](https://code.google.com/u/101374969631348043816/) taken from RayZopf/LSLForge_patched@8e8b8b1 RayZopf/LSLForge_patched@27ea23d RayZopf/LSLForge_patched@af9d403
- sync Render.hs, LslForge.hs and LslForge.cabal - (0.1.6.5) taken from RayZopf/LSLForge_patched@5374c00 RayZopf/LSLForge_patched@d0fed91
|
regarding haskell packages / compile see |
|
There is a math bug in this version with the code optimization: llSleep((0.06 - (llGetTime() - time)) * llGetRegionTimeDilation()); Messing up the operation order |
| (Div _ _) -> 3 | ||
| (Mod _ _) -> 3 | ||
| (Add _ _) -> 4 | ||
| (Sub _ _) -> 4 |
There was a problem hiding this comment.
Have no clue about the Haskell code - but could you test
1 - 1*(5 - 4)
as I asume optimizer does not recognize multiplication when removing/opimizing mathematical terms
this commit RayZopf@d16dc06
maybe here
RayZopf@d16dc06#diff-f3af7582e55ee4f0c7b8b15a86119f84R170
and here
RayZopf@d16dc06#diff-f3af7582e55ee4f0c7b8b15a86119f84L207
There was a problem hiding this comment.
to solve cast of cast bug
((string)((integer)message) == message)) misoptimized to (string)(integer)message == message)
the patch for Render.hs was changed like this:
> lo = \ t -> isLower ex t || needsBooleanParens ex t || castCast ex t
added || castCast ex t
and added this function:
> castCast :: Expr -> Ctx Expr -> Bool
> castCast ex0 (Ctx _ ex1) =
> case ex0 of
> (Cast _ _) -> case ex1 of
> (Cast _ _) -> True
> _ -> False
> _ -> False
>
|
I know about one other bug: (float-variable = number-a / number-b) get's calculated to (f-v = 0); have not tested if the bug is in main LSLForge too, or if only this patched version exposes this miscalculation |
|
Haven't seen the problem on raysilent's branch. |
|
I'm scary to merge at this point |
|
We have to compile and release this master branch though, so everyone enjoys it while we are testing these Haskell modifications. How about that? |
|
what do you think about cherry-picking the last commit/the changes in there?
RayZopf@067cb56 this could also be done manually |
|
I agree that we need someone who can code in Haskell, as the original author of those patches is not available |
|
script to test for both issues |
|
Guys, let's work on |
|
Regarding the "float variable handling" ((float-variable = number-a / number-b) get's calculated to (f-v = 0);): I don't see a bug, because the operation is done exectly like LSL behaves inworld: float fv=1/2; Try the following script inworld: |
keep in sync with upstream
|
tested float/autocast again - see attached script basically the LSLForge.exe in this PR does: do I have to like that? |
I don't know ;) .. But I wouldn't call it an error or bug. I guess it depends on the point of view .. you could also call it a feature, because an integer division is much faster than a float division. (And because both operants are integers, the interpreter could/should guess you would like to perform an integer division) |
|
I wouldn't merge that >_> |
|
float a2 = 10 / 3 (= 3.000000) |
|
I can live with this:
and given the findings, I would not call it a workaround - esp. as it is needed for any LSL script to run correctly (#1 (comment)) |
|
just checked - LSLForge previous to above changes also does autocast integer values within float variables to integer
this is still different to Mono / inworld variable autocast handling- but this behaviour has not been changed by applied patch! |
partly reverted applied patch - ugly - only used on Sub, Div and Mod operations - adding back some unnecessary parenthesis too logic expressions handling (And, Or) seems to be untouched and still correct added comments
partly reverted applied patch - ugly - used on ShiftL and ShiftR too - adds back some unnecessary parenthesis too thanks for pointing out @furroy
Handle associativity similar to precedence - modified/moved Cast of Cast handling - all operators should be covered now - adds too much parenthesis in some cases
|
latest win32 exe files for testing, also one single change that I have not commited yet now: |
- also check for precedence there - late commit, change already mentioned in PR
|
@PellSmit could you take a look into this pull request, please? |
|
@RayZopf,I don't have enough time to do it. |
7ae61d9
needs to be tested extensively because of
lslforge/lslforge/haskell/LslForge.cabal
Line 30 in 7ae61d9
(does it compile?)
I'm also not sure about
master...RayZopf:master#diff-c36d07f78ea57cd86da4be9be4be3014R123
less parentheses/brackets
state version in script output
fixes on handling variables and functions
json support and fix for string issue
update and sync version number