IO - files, etc.

95 views
Skip to first unread message

Felix George

unread,
Nov 2, 2016, 9:50:20 AM11/2/16
to Eve talk
-Is there a way to save to a .txt. file, save JSON to a file, or input JSON from a file stored on the local computer.  Seems an easy enough task, but I may be overlooking something in the documentation?  
-Also, is there a way to save the entire state of the program obviating the need for serializing to a file in other languages like C#?

-How do we find out all of the standard features of the environment, including details of how you interact with the #http tags? With no autocomplete or list of tags, it's hard to gauge what is possible.

-Finally, is there a way to import entire html pages (I see the css is rather straight forward) to supplement the UI of the app being created?  If so, how do you reference the elements in that UI. Or, is everything done programmatically like in the examples?



As you can tell from my questions, I'm not exactly an expert programmer.  Although I'm somewhat proficient with C# and have released several apps, Eve has struck me in an incredible way with its accessibility.  It truly has been groundbreaking just learning it in the last few days.  It's obviously the future of programming for all.

Vicky Chijwani

unread,
Nov 2, 2016, 4:39:28 PM11/2/16
to Eve talk
Hey Felix,

I'm new to Eve like you, but perhaps I can help :)
  • File I/O - There is no way to do traditional file I/O from the browser, because of security restrictions - this is outside Eve's control. But I believe it would be easy to add a new "database" for file I/O that works on the server side.
  • Serializing state - Since all the state in a browser-based Eve program is in the @session database (the default database when none is specified), which is just a list of records, I think it would be simple enough to modify Eve such that we can serialize this into (say) JSON and write it to the browser's local storage.
  • Feature exploration - I don't have much to say except that I'd be surprised if autocomplete wasn't already on the team's roadmap :)
  • Importing HTML - probably no straight-forward way, but what may work is programmatically adding a <script> tag that then injects HTML - although I'm not sure if Eve would be able to react to events, etc from the injected HTML. Example: [#script type: "text/javascript" text: "$('<div></div>').appendTo($('body'))"] (using jQuery syntax for brevity)

Chris Granger

unread,
Nov 2, 2016, 5:28:59 PM11/2/16
to Vicky Chijwani, Eve talk
Vicky's got it right. :)

1) We had reading and writing files in a previous prototype, but we didn't move it over into this one. It's something that'll get added, but there are some interesting semantic questions related to it that need to be thought through.
2) There's a secret command to actually serialize your state right now. If you open the browser dev console and type save(), it'll download an Eve dump as JSON.
3) Yep, lots more tooling is on the way.
4) Importing existing HTML isn't something we've really thought about, but you could technically write a thing that takes existing html and turns it into records. More useful is probably the ability to embed eve in an existing page. The architecture supports that, we just haven't done anything to make that easy.


--
You received this message because you are subscribed to the Google Groups "Eve talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eve-talk+u...@googlegroups.com.
To post to this group, send email to eve-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eve-talk/ab3a7e80-7664-4c25-8ae8-13265b4419fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages