# GScript - A Javascript/ChoiceScript Framework Project

**URL:** <https://forum.choiceofgames.com/t/gscript-a-javascript-choicescript-framework-project/83915>\
**Category:** Game Development\
**Tags:** tips, coder\
**Created:** [August 1, 2020, 4:08am UTC](https://forum.choiceofgames.com/t/gscript-a-javascript-choicescript-framework-project/83915 "2020-08-01T04:08:48Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![choicehacker](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/choicehacker/32/127936_2.png) [@choicehacker](https://forum.choiceofgames.com/u/choicehacker)\
**Post date:** [August 1, 2020, 1:44pm UTC](https://forum.choiceofgames.com/t/gscript-a-javascript-choicescript-framework-project/83915/2 "2020-08-01T13:44:27Z")

</div>

Hi @GoldenSilver. This is very exciting. I like the fact that you used \*script as an escape hatch. It means changes to the core of CS are limited and may require less effort to be integrated for publication. I have a few questions/suggestions:

- Dynamic styles are very nice. From what I see, CS renders all the page in the same “text” div. How can you apply the style selectively? Does \*applyStyle change the whole page? Would it be possible to style specific images or paragraphs in the page?

- I love the object support. Can you explain in more details why you can’t simply do ${instance[field]}. If you keep it simple, you can \*set instance\_field value and get it done.

- In “predicate” shouldn’t variables be referenced as this.stats.VARNAME? This is what works for me. I believe this.created doesn’t hold the value.

- What’s the cost of sorting operation? Do you have to copy the simulated array into a JS array, sort it and copy it back? What about a syntax to just use native arrays directly (similar to your supplyInstance for objects)? I have some thoughts here: [How to deal with arrays](https://forum.choiceofgames.com/t/how-to-deal-with-arrays/82561) (choice #5, and use of tooling to help developers)

- Can you resize or add elements to arrays? I think it would make them usable in a broader context. Eg. infinite growing log. In one of my demos [The Dungeon of Lamurloq (first-person POV dungeon crawler)](https://forum.choiceofgames.com/t/the-dungeon-of-lamurloq-first-person-pov-dungeon-crawler/83883) I use a trick to programmatically allocate an array of given size (from a variable).

- Yes, CONSOLE. Thanks!

- Yes, dynamic creation/removal of variables.

- Functions. Did you look into supporting real, scoped functions? CS gosub can mess up your state if you are not careful.

Thanks for sharing this. I hope it grows into something widely adopted.

---

_[View the full topic](https://forum.choiceofgames.com/t/gscript-a-javascript-choicescript-framework-project/83915)._
